Skip to content

Add setModeConfiguration for monaco.languages.typescript.[typescript|javascript]Defaults #3489

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

Merged
merged 1 commit into from
Jan 31, 2023
Merged

Conversation

joecarl
Copy link
Contributor

@joecarl joecarl commented Jan 5, 2023

This commit implements the functionality requested in #3155.
The work is done based on the implementation for the the css, html and json namespaces.

In this case the ModeConfiguration interface implementation has the following options:

export interface ModeConfiguration {
	/**
	 * Defines whether the built-in completionItemProvider is enabled.
	 */
	readonly completionItems?: boolean;

	/**
	 * Defines whether the built-in hoverProvider is enabled.
	 */
	readonly hovers?: boolean;

	/**
	 * Defines whether the built-in documentSymbolProvider is enabled.
	 */
	readonly documentSymbols?: boolean;

	/**
	 * Defines whether the built-in definitions provider is enabled.
	 */
	readonly definitions?: boolean;

	/**
	 * Defines whether the built-in references provider is enabled.
	 */
	readonly references?: boolean;

	/**
	 * Defines whether the built-in references provider is enabled.
	 */
	readonly documentHighlights?: boolean;

	/**
	 * Defines whether the built-in rename provider is enabled.
	 */
	readonly rename?: boolean;

	/**
	 * Defines whether the built-in diagnostic provider is enabled.
	 */
	readonly diagnostics?: boolean;

	/**
	 * Defines whether the built-in document formatting range edit provider is enabled.
	 */
	readonly documentRangeFormattingEdits?: boolean;

	/**
	 * Defines whether the built-in signature help provider is enabled.
	 */
	readonly signatureHelp?: boolean;

	/**
	 * Defines whether the built-in onType formatting edit provider is enabled.
	 */
	readonly onTypeFormattingEdits?: boolean;

	/**
	 * Defines whether the built-in code actions provider is enabled.
	 */
	readonly codeActions?: boolean;

	/**
	 * Defines whether the built-in inlay hints provider is enabled.
	 */
	readonly inlayHints?: boolean;
}

There are some notes though:

The setupMode implementations for css, html and json return an IDisposable containing all disposable elements created during the function execution. But the setupMode implementation for typescript returns (...uris: Uri[]) => Promise<TypeScriptWorker> containing the worker function. So I implemented the code to collect all disposable elements, but it's useless so far, waiting to be reviewed in future commit.

@joecarl
Copy link
Contributor Author

joecarl commented Jan 5, 2023

@microsoft-github-policy-service agree

@joecarl joecarl changed the title Implemented setModeConfiguration for monaco.languages.typescript.[typescript|javascript]Defaults Add setModeConfiguration for monaco.languages.typescript.[typescript|javascript]Defaults Jan 6, 2023
@hediet hediet merged commit 7c569c1 into microsoft:main Jan 31, 2023
@hediet hediet added this to the January 2023 milestone Jan 31, 2023
@joecarl joecarl deleted the implement-3155 branch January 31, 2023 14:01
@github-actions github-actions bot locked and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants