-
Notifications
You must be signed in to change notification settings - Fork 283
[typespec-vscode] Allow lsp disable running emitters #7576
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
base: main
Are you sure you want to change the base?
[typespec-vscode] Allow lsp disable running emitters #7576
Conversation
You can try these changes here
|
@timotheeguerin please help review |
createClientConfigProvider, | ||
} from "../../src/server/client-config-provider.js"; | ||
|
||
describe("compiler: server: client-config-provider", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove top level describe
"typespec.lsp.emit": { | ||
"type": "array", | ||
"default": null, | ||
"description": "List of emitters that should be included in compilation in typespec LSP server when supporting LSP related functionalities.\n\nExample:\n\"typespec.lsp.emit\": [\n \"@typespec/openapi3\"\n]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should describe that this will just run the emitter in dry mode for emitters that support it even if you enable it
* @param defaultValue Default value if not found | ||
* @returns The configuration value or default | ||
*/ | ||
get<T>(section: string): T | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not have the known config itself be typed instead of having this be done at the point of usage?
// If emit is set in additionalOptions, use this setting first | ||
// otherwise, obtain the `typespec.lsp.emit` configuration from clientConfigsProvider | ||
if (additionalOptions?.emit === undefined) { | ||
const configEmits = clientConfigsProvider?.get<string[]>("typespec.lsp.emit"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clientConfigsProvider?.config?.lsp?.emit
I think would be a simpler experience
- typespec-vscode | ||
--- | ||
|
||
Allow LSP to run emitters configured by users in the settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow LSP to run emitters configured by users in the settings | |
Allow LSP to configure which emitters to include for live checks |
|
||
// Verify configuration was fetched and applied | ||
strictEqual(mockConnection.workspace.getConfiguration.mock.calls.length, 1); | ||
strictEqual(mockConnection.workspace.getConfiguration.mock.calls[0]?.[0], "typespec"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use instead expect().toHaveBeenCalled
Fix: #7305
Allow lsp disable running emitters