Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Diagnostics): Add proposed DiagnosticTag.Deprecated enum member #77760

Merged
merged 17 commits into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vs/editor/browser/widget/codeEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1851,4 +1851,6 @@ registerThemingParticipant((theme, collector) => {
if (unnecessaryBorder) {
collector.addRule(`.${SHOW_UNUSED_ENABLED_CLASS} .monaco-editor .${ClassName.EditorUnnecessaryDecoration} { border-bottom: 2px dashed ${unnecessaryBorder}; }`);
}

collector.addRule(`.monaco-editor .${ClassName.EditorDeprecatedInlineDecoration} { text-decoration: line-through; }`);
});
3 changes: 2 additions & 1 deletion src/vs/editor/common/model/intervalTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export const enum ClassName {
EditorWarningDecoration = 'squiggly-warning',
EditorErrorDecoration = 'squiggly-error',
EditorUnnecessaryDecoration = 'squiggly-unnecessary',
EditorUnnecessaryInlineDecoration = 'squiggly-inline-unnecessary'
EditorUnnecessaryInlineDecoration = 'squiggly-inline-unnecessary',
EditorDeprecatedInlineDecoration = 'squiggly-inline-deprecated'
}

export const enum NodeColor {
Expand Down
3 changes: 3 additions & 0 deletions src/vs/editor/common/services/markerDecorationsServiceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ export class MarkerDecorationsService extends Disposable implements IMarkerDecor
if (marker.tags.indexOf(MarkerTag.Unnecessary) !== -1) {
inlineClassName = ClassName.EditorUnnecessaryInlineDecoration;
}
if (marker.tags.indexOf(MarkerTag.Deprecated) !== -1) {
inlineClassName = ClassName.EditorDeprecatedInlineDecoration;
}
}

return {
Expand Down
3 changes: 2 additions & 1 deletion src/vs/editor/common/standalone/standaloneEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@


export enum MarkerTag {
Unnecessary = 1
Unnecessary = 1,
Deprecated = 2
}

export enum MarkerSeverity {
Expand Down
3 changes: 2 additions & 1 deletion src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ declare namespace monaco {


export enum MarkerTag {
Unnecessary = 1
Unnecessary = 1,
Deprecated = 2
}

export enum MarkerSeverity {
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/markers/common/markers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface IRelatedInformation {

export const enum MarkerTag {
Unnecessary = 1,
Deprecated = 2
}

export enum MarkerSeverity {
Expand Down
14 changes: 14 additions & 0 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1274,4 +1274,18 @@ declare module 'vscode' {
}

//#endregion

//#region Deprecated support

export enum DiagnosticTag {
/**
* Deprecated or obsolete code
*
* Can be used to style with strikeout or other "obsolete" styling. See:
* https://github.com/microsoft/vscode/issues/50972
*/
Deprecated = 2,
}

//#endregion
}
2 changes: 2 additions & 0 deletions src/vs/workbench/api/common/extHostTypeConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export namespace DiagnosticTag {
switch (value) {
case types.DiagnosticTag.Unnecessary:
return MarkerTag.Unnecessary;
case types.DiagnosticTag.Deprecated:
return MarkerTag.Deprecated;
}
return undefined;
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/api/common/extHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ export class SnippetString {

export enum DiagnosticTag {
Unnecessary = 1,
Deprecated = 2
}

export enum DiagnosticSeverity {
Expand Down