Skip to content

Commit e3942e8

Browse files
committed
add inspectPort setting
1 parent 73886ff commit e3942e8

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

packages/vscode-tailwindcss/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@
180180
"type": "number",
181181
"default": 16,
182182
"markdownDescription": "Root font size in pixels. Used to convert `rem` CSS values to their `px` equivalents. See `#tailwindCSS.showPixelEquivalents#`."
183+
},
184+
"tailwindCSS.inspectPort": {
185+
"type": [
186+
"number",
187+
"null"
188+
],
189+
"default": null,
190+
"markdownDescription": "Enable the Node.js inspector agent for the language server and listen on the specified port."
183191
}
184192
}
185193
}

packages/vscode-tailwindcss/src/extension.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,19 @@ export async function activate(context: ExtensionContext) {
179179
commands.executeCommand('setContext', 'tailwindCSS.hasOutputChannel', true)
180180
}
181181

182+
let configuration = {
183+
editor: Workspace.getConfiguration('editor', folder),
184+
tailwindCSS: Workspace.getConfiguration('tailwindCSS', folder),
185+
}
186+
187+
let inspectPort = configuration.tailwindCSS.get('inspectPort')
188+
182189
let serverOptions: ServerOptions = {
183-
run: { module, transport: TransportKind.ipc },
190+
run: {
191+
module,
192+
transport: TransportKind.ipc,
193+
options: { execArgv: inspectPort === null ? [] : [`--inspect=${inspectPort}`] },
194+
},
184195
debug: {
185196
module,
186197
transport: TransportKind.ipc,
@@ -189,6 +200,7 @@ export async function activate(context: ExtensionContext) {
189200
},
190201
},
191202
}
203+
192204
let clientOptions: LanguageClientOptions = {
193205
documentSelector: languages.get(folder.uri.toString()).map((language) => ({
194206
scheme: 'file',
@@ -314,10 +326,7 @@ export async function activate(context: ExtensionContext) {
314326
},
315327
initializationOptions: {
316328
userLanguages: getUserLanguages(folder),
317-
configuration: {
318-
editor: Workspace.getConfiguration('editor', folder),
319-
tailwindCSS: Workspace.getConfiguration('tailwindCSS', folder),
320-
},
329+
configuration,
321330
},
322331
synchronize: {
323332
configurationSection: ['editor', 'tailwindCSS'],

0 commit comments

Comments
 (0)