Skip to content

Commit edf17bd

Browse files
committed
fix: update vscode types package and clean up now unused line comment types
VScode updated their types to include the LineComment typings and released 1.110 of @types/vscode package. So our temporary custom `LineComment` type and `LineCommentConfig` interface is now redundant. - Updated @types/vscode package to 1.110. - Removed the temporary `LineComment` type and `LineCommentConfig` interface, and removed the references in configuration file.
1 parent 5b29d71 commit edf17bd

3 files changed

Lines changed: 3 additions & 35 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"devDependencies": {
117117
"@types/mocha": "^10.0.9",
118118
"@types/node": "^22.9.0",
119-
"@types/vscode": "^1.96",
119+
"@types/vscode": "^1.110",
120120
"mocha": "^10.8.2",
121121
"typescript": "^5.7"
122122
},

src/configuration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {logger} from "./logger";
1212
import * as utils from "./utils";
1313
import {ExtensionData} from "./extensionData";
1414
import {Settings} from "./interfaces/settings";
15-
import {ExtraSingleLineCommentStyles, LineComment, SingleLineCommentStyle} from "./interfaces/commentStyles";
15+
import {ExtraSingleLineCommentStyles, SingleLineCommentStyle} from "./interfaces/commentStyles";
1616
import {ExtensionMetaData} from "./interfaces/extensionMetaData";
1717
import {JsonObject, JsonArray, LanguageId, MultiLineLanguageDefinitions, SingleLineLanguageDefinitions} from "./interfaces/utils";
1818
import {CommandRegistration} from "./interfaces/commands";
@@ -599,7 +599,7 @@ export class Configuration {
599599
// If the config object has own property of comments AND the comments key has
600600
// own property of lineComment...
601601
if (Object.hasOwn(config, "comments") && Object.hasOwn(config.comments, "lineComment")) {
602-
let lineComment: LineComment = config.comments.lineComment as LineComment;
602+
let lineComment = config.comments.lineComment;
603603

604604
// Line comments can be a string or an object with a "comment" key.
605605
// If the lineComment is an object, get the "comment" key value.

src/interfaces/commentStyles.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,3 @@ export type SingleLineCommentStyle = "//" | "#" | ";";
77
* Define the extra single-line comment styles, like `///`, etc.
88
*/
99
export type ExtraSingleLineCommentStyles = "##" | ";;" | "///" | "//!";
10-
11-
/**
12-
* Line Comments
13-
*
14-
* Taken directly from VScode's commit in June 2025 that changed the line comment config.
15-
* https://github.com/microsoft/vscode/commit/d9145a291dcef0bad3ace81a3d55727ca294c122#diff-0dfa7db579eface8250affb76bc88717725a121401d4d8598bc36b92b0b6ef62
16-
*
17-
* The @types/vscode package does not yet have these changes.
18-
* So until they're added, we define them manually.
19-
*/
20-
21-
/**
22-
* The line comment token, like `// this is a comment`.
23-
* Can be a string, an object with comment and optional noIndent properties, or null.
24-
*/
25-
export type LineComment = string | LineCommentConfig | null;
26-
27-
/**
28-
* Configuration for line comments.
29-
*/
30-
export interface LineCommentConfig {
31-
/**
32-
* The line comment token, like `//`
33-
*/
34-
comment: string;
35-
36-
/**
37-
* Whether the comment token should not be indented and placed at the first column.
38-
* Defaults to false.
39-
*/
40-
noIndent?: boolean;
41-
}

0 commit comments

Comments
 (0)