Skip to content

Conversation

dklilley
Copy link
Member

@dklilley dklilley commented May 31, 2023

This change resolves two bugs:

  1. When files are closed, any linting diagnostics should be cleared
  2. Fixed launching MATLAB when the MATLAB Connection Timing setting is set to onDemand
@dklilley dklilley requested a review from gauravsavadi May 31, 2023 17:55
@dklilley dklilley changed the title Dklilley.bugs mar30 Clear linting diagnostics & fix launching w/ onDemand setting May 31, 2023
@dklilley dklilley self-assigned this May 31, 2023
@dklilley dklilley requested a review from jdhameli May 31, 2023 17:59
})
}

clearDiagnosticsForDocument (textDocument: TextDocument): void {
Copy link
Member

Choose a reason for hiding this comment

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

Consider passing just the uri here.

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 had considered this, but decided on passing the TextDocument for two reasons:

  1. I think this makes the API a bit more readable (clearing diagnostics for a document vs. a URI)
  2. This matches the other APIs in the file (queueLintingForDocument and lintDocument)

// No active connection - should create a connection if desired
if (await this._isMatlabConnectionTimingNever()) {
if (!(await this._isMatlabConnectionTimingNever())) {
Copy link
Member

Choose a reason for hiding this comment

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

Does this require a comment explaining the change?

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 don't believe so. This bug was introduced by some refactoring in #1, so this change is simply correcting the if-statement.

@dklilley dklilley merged commit 5a079ca into mathworks:main May 31, 2023
@dklilley dklilley deleted the dklilley.Bugs_Mar30 branch May 31, 2023 18:54
diningPhilosopher64 pushed a commit to diningPhilosopher64/MATLAB-language-server that referenced this pull request Jul 2, 2024
…ment Features: Linting (with quick fixes) and Format Document
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants