Skip to content

Commit

Permalink
Merge pull request #77760 from kamranayub/feat/gh-56694/deprecated
Browse files Browse the repository at this point in the history
feat(Diagnostics): Add proposed DiagnosticTag.Deprecated enum member
  • Loading branch information
jrieken authored Jul 26, 2019
2 parents 141617c + 29f6ec0 commit ff04171
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 3 deletions.
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 @@ -1848,4 +1848,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 @@ -29,7 +29,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 @@ -1290,4 +1290,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

0 comments on commit ff04171

Please sign in to comment.