add `inspectPort` setting
parent
73886ffbf0
commit
e3942e89e4
|
@ -180,6 +180,14 @@
|
|||
"type": "number",
|
||||
"default": 16,
|
||||
"markdownDescription": "Root font size in pixels. Used to convert `rem` CSS values to their `px` equivalents. See `#tailwindCSS.showPixelEquivalents#`."
|
||||
},
|
||||
"tailwindCSS.inspectPort": {
|
||||
"type": [
|
||||
"number",
|
||||
"null"
|
||||
],
|
||||
"default": null,
|
||||
"markdownDescription": "Enable the Node.js inspector agent for the language server and listen on the specified port."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,8 +179,19 @@ export async function activate(context: ExtensionContext) {
|
|||
commands.executeCommand('setContext', 'tailwindCSS.hasOutputChannel', true)
|
||||
}
|
||||
|
||||
let configuration = {
|
||||
editor: Workspace.getConfiguration('editor', folder),
|
||||
tailwindCSS: Workspace.getConfiguration('tailwindCSS', folder),
|
||||
}
|
||||
|
||||
let inspectPort = configuration.tailwindCSS.get('inspectPort')
|
||||
|
||||
let serverOptions: ServerOptions = {
|
||||
run: { module, transport: TransportKind.ipc },
|
||||
run: {
|
||||
module,
|
||||
transport: TransportKind.ipc,
|
||||
options: { execArgv: inspectPort === null ? [] : [`--inspect=${inspectPort}`] },
|
||||
},
|
||||
debug: {
|
||||
module,
|
||||
transport: TransportKind.ipc,
|
||||
|
@ -189,6 +200,7 @@ export async function activate(context: ExtensionContext) {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
let clientOptions: LanguageClientOptions = {
|
||||
documentSelector: languages.get(folder.uri.toString()).map((language) => ({
|
||||
scheme: 'file',
|
||||
|
@ -314,10 +326,7 @@ export async function activate(context: ExtensionContext) {
|
|||
},
|
||||
initializationOptions: {
|
||||
userLanguages: getUserLanguages(folder),
|
||||
configuration: {
|
||||
editor: Workspace.getConfiguration('editor', folder),
|
||||
tailwindCSS: Workspace.getConfiguration('tailwindCSS', folder),
|
||||
},
|
||||
configuration,
|
||||
},
|
||||
synchronize: {
|
||||
configurationSection: ['editor', 'tailwindCSS'],
|
||||
|
|
Loading…
Reference in New Issue