Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
5 changes: 4 additions & 1 deletion Documentation/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ lookup the PATH first to see if there's a matching install, etc.
"version": "8.0",
"mode": "aspnetcore"
}
```
```

Note: If you are a developer for a highly used extension or an extension that is provided by Microsoft, you may be in our 'skip' list to enhance performance.
Please check the list if this is not working for you and ask us to exclude you: [Skipped Extensions](https://github.com/dotnet/vscode-dotnet-runtime/blob/main/vscode-dotnet-runtime-library/src/Acquisition/JsonInstaller.ts).
127 changes: 126 additions & 1 deletion vscode-dotnet-runtime-library/src/Acquisition/JsonInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,131 @@ import { IJsonInstaller } from "./IJsonInstaller";

export class JsonInstaller extends IJsonInstaller
{
private readonly knownCommonExtensionIdsNotUsingDotnet: Set<string> = new Set<string>([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to do this the other way around?
That may need to have a way to specify additional extensions locally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, do you mean inclusive instead of exclusive? I think that's a good idea, but I worry it would harm the adoption/usefulness of our API by only allowlisting certain extensions to use it. Worst case, I could see that coming up in an anti-competitive practice lawsuit, which concerns me.

Now, maybe we could add some other way for extensions to specify they want us to do something. However, this needs to be done at activation before other extensions can run. We could ask them to ship with an additional manifest file, perhaps... though I'm not sure if we would be privy to that logic, and that risks things like protected files / bad read access, so I think I prefer this approach. Thanks for taking a look 👀

'vscode.bat',
'vscode.clojure',
'vscode.coffeescript',
'vscode.configuration-editing',
'vscode.cpp',
'vscode.css',
'vscode.css-language-features',
'vscode.dart',
'vscode.debug-auto-launch',
'vscode.debug-server-ready',
'vscode.diff',
'vscode.docker',
'vscode.emmet',
'vscode.extension-editing',
'vscode.fsharp',
'vscode.git',
'vscode.git-base',
'vscode.github',
'vscode.github-authentication',
'vscode.go',
'vscode.groovy',
'vscode.grunt',
'vscode.gulp',
'vscode.handlebars',
'vscode.hlsl',
'vscode.html',
'vscode.html-language-features',
'vscode.ini',
'vscode.ipynb',
'vscode.jake',
'vscode.java',
'vscode.javascript',
'vscode.json',
'vscode.json-language-features',
'vscode.julia',
'vscode.latex',
'vscode.less',
'vscode.log',
'vscode.lua',
'vscode.make',
'vscode.markdown',
'vscode.markdown-language-features',
'vscode.markdown-math',
'vscode.media-preview',
'vscode.merge-conflict',
'vscode.microsoft-authentication',
'ms-vscode.js-debug',
'ms-vscode.js-debug-companion',
'ms-vscode.vscode-js-profile-table',
'vscode.builtin-notebook-renderers',
'vscode.npm',
'vscode.objective-c',
'vscode.perl',
'vscode.php',
'vscode.php-language-features',
'vscode.powershell',
'vscode.pug',
'vscode.python',
'vscode.r',
'vscode.razor',
'vscode.references-view',
'vscode.restructuredtext',
'vscode.ruby',
'vscode.rust',
'vscode.scss',
'vscode.search-result',
'vscode.shaderlab',
'vscode.shellscript',
'vscode.simple-browser',
'vscode.sql',
'vscode.swift',
'vscode.terminal-suggest',
'vscode.theme-abyss',
'vscode.theme-defaults',
'vscode.theme-kimbie-dark',
'vscode.theme-monokai',
'vscode.theme-monokai-dimmed',
'vscode.theme-quietlight',
'vscode.theme-red',
'vscode.vscode-theme-seti',
'vscode.theme-solarized-dark',
'vscode.theme-solarized-light',
'vscode.theme-tomorrow-night-blue',
'vscode.tunnel-forwarding',
'vscode.typescript',
'vscode.typescript-language-features',
'vscode.vb',
'vscode.xml',
'vscode.yaml',
'GitHub.copilot',
'GitHub.copilot-chat',
'GitHub.vscode-pull-request-github',
'ms-vscode-remote.remote-wsl',
'ms-vscode.hexeditor',
'ms-vscode.powershell',
'ms-vscode.vscode-typescript-next',
'ms-python.python',
'ms-python.vscode-pylance',
'ms-toolsai.jupyter',
'ms-toolsai.jupyter-renderers',
'ms-toolsai.jupyter-keymap',
'ms-toolsai.jupyter-cell-tags',
'ms-vscode.cpptools',
'ms-vscode.cpptools-extension-pack',
'ms-python.debugpy',
'VisualStudioExptTeam.vscodeintellicode',
'VisualStudioExptTeam.vscodeintellicode-api',
'VisualStudioExptTeam.vscodeintellicode-azureapi',
'VisualStudioExptTeam.vscodeintellicode-azureapi-preview',
'redhat.java',
'redhat.vscode-yaml',
'ms-azuretools.vscode-docker',
'ms-azuretools.vscode-azureresourcegroups',
'ms-azuretools.vscode-azureresourcegroups-explorer',
'ms-vscode-remote.remote-wsl',
'ms-vscode-remote.remote-containers',
'ms-vscode-remote.remote-ssh',
'ms-vscode-remote.remote-ssh-edit',
'ms-vscode-remote.remote-ssh-explorer',
'ms-vscode-remote.remote-tunnels',
'ms-vscode-remote.remote-wsl-edit',
'GitHub.vscode-pull-request-github',
]);

constructor(protected readonly eventStream: IEventStream, protected readonly vscodeAccessor: IVSCodeExtensionContext)
{
super(eventStream, vscodeAccessor);
Expand All @@ -31,7 +156,7 @@ export class JsonInstaller extends IJsonInstaller
// eslint-disable-next-line @typescript-eslint/require-await
public async executeJSONRequests(): Promise<void>
{
const extensions = this.vscodeAccessor.getExtensions();
const extensions = this.vscodeAccessor.getExtensions().filter((extension) => !this.knownCommonExtensionIdsNotUsingDotnet.has(extension.id));
for (const extension of extensions)
{
const extensionPackage = extension?.packageJSON;
Expand Down
11 changes: 6 additions & 5 deletions vscode-dotnet-runtime-library/src/VSCodeExtensionContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export class VSCodeExtensionContext extends IVSCodeExtensionContext
{
private context: vscode.ExtensionContext;

constructor(trueContext : vscode.ExtensionContext)
constructor(trueContext: vscode.ExtensionContext)
{
super();
this.context = trueContext;
}

public setVSCodeEnvironmentVariable(variable : string, value : string) : void
public setVSCodeEnvironmentVariable(variable: string, value: string): void
{
const environment = this.context.environmentVariableCollection;
environment.replace(variable, value);
Expand All @@ -30,17 +30,18 @@ export class VSCodeExtensionContext extends IVSCodeExtensionContext

public registerOnExtensionChange<A extends any[], R>(f: (...args: A) => R, ...args: A): void
{
vscode.extensions.onDidChange(() => {
vscode.extensions.onDidChange(() =>
{
f(...(args));
})
}

public getExtensions() : readonly vscode.Extension<any>[]
public getExtensions(): readonly vscode.Extension<any>[]
{
return vscode.extensions.all;
}

public executeCommand(command : string, ...args: any[]) : Thenable<any>
public executeCommand(command: string, ...args: any[]): Thenable<any>
{
return vscode.commands.executeCommand(command, ...args);
}
Expand Down