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: "deno.internalInspect" setting #1007

Merged
merged 4 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ extension has the following configuration options:
hints where the variable name matches the implicit type.
- `deno.internalDebug`: If enabled the Deno Language Server will log additional
internal diagnostic information.
- `deno.internalInspect`: Enables the inspector server for the JS runtime used
by the Deno Language Server to host its TS server.
- `deno.lint`: Controls if linting information will be provided by the Deno
Language Server. _boolean, default `true`_
- `deno.maxTsServerMemory`: Maximum amount of memory the TypeScript isolate can
Expand Down
7 changes: 6 additions & 1 deletion client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,17 @@ export function startLanguageServer(
return;
}

const env = {
const env: Record<string, unknown> = {
...process.env,
"DENO_V8_FLAGS": getV8Flags(),
"NO_COLOR": true,
};

const config = vscode.workspace.getConfiguration(EXTENSION_NS);
if (config.get("internalInspect")) {
env["DENO_LSP_INSPECTOR"] = 1;
}

const serverOptions: ServerOptions = {
run: {
command,
Expand Down
2 changes: 2 additions & 0 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const workspaceSettingsKeys: Array<keyof Settings> = [
"importMap",
"inlayHints",
"internalDebug",
"internalInspect",
"lint",
"logFile",
"path",
Expand Down Expand Up @@ -178,6 +179,7 @@ function handleConfigurationChange(event: vscode.ConfigurationChangeEvent) {
event.affectsConfiguration("deno.enable") ||
event.affectsConfiguration("deno.disablePaths") ||
event.affectsConfiguration("deno.enablePaths") ||
event.affectsConfiguration("deno.internalInspect") ||
event.affectsConfiguration("deno.logFile") ||
event.affectsConfiguration("deno.path") ||
event.affectsConfiguration("deno.maxTsServerMemory")
Expand Down
1 change: 1 addition & 0 deletions client/src/shared_types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export interface Settings {
/** A flag that enables additional internal debug information to be printed
* to the _Deno Language Server_ output. */
internalDebug: boolean;
internalInspect: boolean;
nayeemrmn marked this conversation as resolved.
Show resolved Hide resolved
/** Determine if the extension should be providing linting diagnostics. */
lint: boolean;
logFile: boolean;
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@
false
]
},
"deno.internalInspect": {
"type": "boolean",
"default": false,
"markdownDescription": "Enables the inspector server for the JS runtime used by the Deno Language Server to host its TS server.",
"scope": "window",
"examples": [
true,
false
]
},
"deno.logFile": {
"type": "boolean",
"default": false,
Expand Down
1 change: 1 addition & 0 deletions typescript-deno-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const defaultSettings: Settings = {
importMap: null,
inlayHints: null,
internalDebug: false,
internalInspect: false,
lint: false,
logFile: false,
path: null,
Expand Down
Loading