vsce-toolroom / vscode-textmate-languageservice

Language APIs and support features from Textmate tokenization in Visual Studio Code.
Other
16 stars 0 forks source link

Mark `TextmateLanguageService~context` argument as optional #21

Closed zm-cttae closed 1 year ago

zm-cttae commented 1 year ago

⚡️️ Feature Request

Is your feature request related to a problem?

Currently the main class TextmateLanguageService depends on the vscode.ExtensionContext extension instance.
This isn't necessary thanks to VS Code API's extensions namespace.
We would also be able to initialise the service anywhere in the extension.

The signature is:

export default class TextmateLanguageService {
    constructor(public readonly languageId: string, public readonly context?: vscode.ExtensionContext) {
        // ...
    }
}

Describe the solution you'd like

We can use vscode.extensions.all - a public registry of vscode.Extension[]..
That can take ownership of all the extension contribution interfaces, and create a new custom registry.

Describe alternatives you've considered

Refactoring the vscode.ExtensionContext mock from test util into source code but why keep it?

zm-cttae commented 1 year ago

changed due date to April 01, 2023

zm-cttae commented 1 year ago

changed due date to May 01, 2023

zm-cttae commented 1 year ago

Keeping the vscode.ExtensionContext mock in order to test backwards compat of API.

zm-cttae commented 1 year ago

✅ Work is Definition of Done :)