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

fix: do not call doctor.check() on each build target compilation end #3768

Merged
merged 8 commits into from
Mar 31, 2022

Conversation

kpodsiad
Copy link
Member

@kpodsiad kpodsiad commented Mar 29, 2022

closes #3755
needs scalameta/metals-vscode#930

Because Compilations.scala uses BatchedFunction to batch multiple requests it's very tempting to add there the callback that will execute doctor refresh. But I didn't want to couple doctor and compilations so I created Subject, should I just use () => doctor.executeRefreshDoctor as a Compilations's constructor argument?

Copy link
Member Author

@kpodsiad kpodsiad left a comment

Choose a reason for hiding this comment

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

Actually, creating a new client's provider option should solve all of the above-mentioned suggestions. doctorVisibilityProvider?

@kpodsiad kpodsiad marked this pull request as ready for review March 29, 2022 12:18
@kpodsiad kpodsiad requested review from dos65 and ckipp01 March 29, 2022 12:19
Comment on lines +102 to +137
```typescript
interface InitializationOptions: {
compilerOptions: {
completionCommand?: string;
isCompletionItemDetailEnabled?: boolean;
isCompletionItemDocumentationEnabled?: boolean;
isCompletionItemResolve?: boolean;
isHoverDocumentationEnabled?: boolean;
isSignatureHelpDocumentationEnabled?: boolean;
overrideDefFormat?: "ascii" | "unicode";
parameterHintsCommand?: string;
snippetAutoIndent?: boolean;
}
"copyWorksheetOutputProvider": boolean,
"debuggingProvider": boolean,
"decorationProvider": boolean,
"didFocusProvider": boolean,
"disableColorOutput" boolean,
"doctorProvider": "json" | "html",
"executeClientCommandProvider": boolean,
"globSyntax": "vscode" | "uri"
"icons": "octicons" | "vscode" | "unicode",
"inlineDecorationProvider": boolean,
"inputBoxProvider": boolean,
"isExitOnShutdown" : boolean,
"isHttpEnabled": boolean,
"commandInHtmlFormat": "vscode" | "sublime",
"openFilesOnRenameProvider": boolean,
"openNewWindowProvider": boolean,
"quickPickProvider": boolean,
"renameFileThreshold": number,
"slowTaskProvider": boolean,
"statusBarProvider": "on" | "off" | "show-message" | "log-message",
"treeViewProvider": boolean
debuggingProvider?: boolean;
decorationProvider?: boolean;
inlineDecorationProvider?: boolean;
didFocusProvider?: boolean;
doctorProvider?: "json" | "html";
executeClientCommandProvider?: boolean;
globSyntax?: "vscode" | "uri";
icons?: "vscode" | "octicons" | "atom" | "unicode";
inputBoxProvider?: boolean;
isVirtualDocumentSupported?: boolean;
isExitOnShutdown?: boolean;
isHttpEnabled?: boolean;
openFilesOnRenameProvider?: boolean;
quickPickProvider?: boolean;
renameFileThreshold?: number;
slowTaskProvider?: boolean;
statusBarProvider?: "on" | "off" | "log-message" | "show-message";
treeViewProvider?: boolean;
testExplorerProvider?: boolean;
openNewWindowProvider?: boolean;
copyWorksheetOutputProvider?: boolean;
commandInHtmlFormat?: "vscode" | "sublime";
doctorVisibilityProvider?: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

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

I copypasted typescript interface from metals-language-client - I think it's easier to maintain it this way. It's also more accurate because it indicates that these properties are optional and don't have to be set.

Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

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

Overall looks good.
I have only one comment about Subject

@kpodsiad
Copy link
Member Author

@dos65 I removed Subject. I also encourage you to do reviews in metals-vscode and language-client ;)

Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calls to doctor.check on each build target compilation significantly degrade performance
3 participants