Skip to content

feat(editor): Only watch .oxlintrc.json or user supplied config paths#9731

Merged
Sysix merged 1 commit intooxc-project:mainfrom
nrayburn-tech:only-watch-relevant-config-files
Mar 13, 2025
Merged

feat(editor): Only watch .oxlintrc.json or user supplied config paths#9731
Sysix merged 1 commit intooxc-project:mainfrom
nrayburn-tech:only-watch-relevant-config-files

Conversation

@nrayburn-tech
Copy link
Collaborator

This works by detecting if the user changes the config setting and restarting the language client to pick up the new watchers.

@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 13, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@github-actions github-actions bot added A-editor Area - Editor and Language Server C-enhancement Category - New feature or request labels Mar 13, 2025
@Sysix
Copy link
Member

Sysix commented Mar 13, 2025

When I change the ConfigPath, the LSP-Server is erroring:

2025-03-13 19:16:14.850 [info] [2025-03-13T18:16:14Z INFO  oxc_language_server] initialize: Options { run: OnSave, enable: true, config_path: "oxlint.json" }
[2025-03-13T18:16:14Z INFO  oxc_language_server] language server version: "0.15.14"

2025-03-13 19:16:24.920 [info] [2025-03-13T18:16:24Z INFO  oxc_language_server] 
            configuration changed:
            incoming: Options { run: OnType, enable: true, config_path: "oxlint.json" }
            current: Options { run: OnSave, enable: true, config_path: "oxlint.json" }
            
// here I changed oxc.configPath
2025-03-13 19:16:48.496 [info] [Error - 7:16:48 PM] Server process exited with code 0.
2025-03-13 19:16:48.547 [info] [2025-03-13T18:16:48Z INFO  oxc_language_server] initialize: Options { run: OnSave, enable: true, config_path: "oxlint.json" }
[2025-03-13T18:16:48Z INFO  oxc_language_server] language server version: "0.15.14"

// here I tried it again
2025-03-13 19:16:52.271 [info] [Error - 7:16:52 PM] Server process exited with code 0.
2025-03-13 19:16:52.337 [info] [2025-03-13T18:16:52Z INFO  oxc_language_server] initialize: Options { run: OnSave, enable: true, config_path: "oxlint.json" }
[2025-03-13T18:16:52Z INFO  oxc_language_server] language server version: "0.15.14"

@nrayburn-tech
Copy link
Collaborator Author

@Sysix I haven't looked into it much, but would that not be expected behavior from triggering a restart? If there's a way to swap the file watchers without a restart, I'm happy to change this to do so.

https://github.com/oxc-project/oxc/pull/9731/files#diff-89dc9329e9c578f6c604a85ed0c23a4baa0e9da4b93aa22efefc66ff3933e726R231-R235

@Sysix
Copy link
Member

Sysix commented Mar 13, 2025

I haven't looked into it much, but would that not be expected behavior from triggering a restart?

No before the server reinit the config without any errors.
I pulled from the newest main and now I get the error there too. Interesting :/ I guess this has something to do with the latest changes from #9383

@Sysix Sysix merged commit 27d6e9b into oxc-project:main Mar 13, 2025
18 checks passed
Boshen added a commit that referenced this pull request Mar 16, 2025
## [0.16.0] - 2025-03-16

- 225e266 linter: [**BREAKING**] Enable `--experimental-nested-config`
by default and add `--disable-nested-config` option (#9760) (camchenry)

### Features

- 27d6e9b editor: Only watch .oxlintrc.json or user supplied config
paths (#9731) (Nicholas Rayburn)
- 8dd6809 linter: Add `eslint/no-lonely-if` (#9660) (therewillbecode)
- c22276e oxc_linter: Sort rules by plugin and rule name when outputting
resolved config as a JSON string (#9799) (Nicholas Rayburn)

### Bug Fixes

- 22f18ac linter: Improve `jsx-a11y/anchor-ambiguous-text` diagnostic
message (#9789) (1zumii)
- 6c11740 linter: False positive in `unicorn/catch-error-name` (#9763)
(shulaoda)

### Documentation

- ea6b6d9 linter: Improve docs for `eslint-valid-typeof` (#9797)
(therewillbecode)
- 2c48fba linter: Fix typo in `oxc/bad-min-max-func` (#9791) (Flo)
- 210b876 linter: Improve `eslint-no-async-promise-executor` (#9778)
(therewillbecode)
- f8628bc linter: Improve `eslint-no-class-assign` (#9779)
(therewillbecode)
- faca7a8 linter: Improve `eslint-no-self-assign` (#9768)
(therewillbecode)

### Refactor

- 227d203 linter: Improve `typescript-no-unnecessary-type-constraint`
(#9798) (therewillbecode)
- 05fe2cd linter: Use `is_lexical` when checking for lexical decl
(#9781) (camc314)
- fcdd810 linter: Remove if let nesting from `unicorn-no-date-clone`
(#9767) (therewillbecode)
- 5a9e1b9 linter: Improve `typescript-no-misused-new` (#9766)
(therewillbecode)
- 9df5565 linter: Improve `unicorn/filename-case` (#9762) (shulaoda)
- b0b1f18 linter: Remove if let nesting from
`nextjs-no-async-client-component` (#9764) (therewillbecode)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
camchenry pushed a commit that referenced this pull request Mar 17, 2025
@nrayburn-tech nrayburn-tech deleted the only-watch-relevant-config-files branch July 10, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-editor Area - Editor and Language Server C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants