Skip to content

Commit bb8a078

Browse files
committed
feat(language_server): use linter runtime (#10268)
closes #7118 Added tests for: - (language_server & VSCode) nested configuration - (language_server & VSCode) nested configuration extends - (language_server) without nested configuration The implementation requires at the moment a feature flag for `oxc_linter`. I added documentation in `runtime.rs` to let others know why this is needed. Maybe someone can refactor it to avoid the flag. My first idea is a Trait for file system, but you guys know what to do <3 ![grafik](https://github.com/user-attachments/assets/9bb3aa67-c376-4f51-8474-1d0837d78338)
1 parent 0a42695 commit bb8a078

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+822
-365
lines changed

Cargo.lock

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/oxc_language_server/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@ doctest = false
2323

2424
[dependencies]
2525
oxc_allocator = { workspace = true }
26-
oxc_data_structures = { workspace = true, features = ["rope"] }
2726
oxc_diagnostics = { workspace = true }
28-
oxc_linter = { workspace = true }
29-
oxc_parser = { workspace = true }
30-
oxc_semantic = { workspace = true }
27+
oxc_linter = { workspace = true, features = ["language_server"] }
3128

32-
cow-utils = { workspace = true }
29+
#
3330
env_logger = { workspace = true, features = ["humantime"] }
3431
futures = { workspace = true }
3532
globset = { workspace = true }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"./config/.oxlintrc.json"
4+
]
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": [
3+
"import"
4+
],
5+
"rules": {
6+
"import/no-cycle": "error"
7+
}
8+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// should report cycle detected
2+
import { b } from './dep-b.ts';
3+
4+
b();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// this file is also included in dep-a.ts and dep-a.ts should report a no-cycle diagnostic
2+
import './dep-a.ts';
3+
4+
export function b() { /* ... */ }
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// should report cycle detected
2+
import { b } from './dep-b.ts';
3+
4+
b();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// this file is also included in dep-a.ts and dep-a.ts should report a no-cycle diagnostic
2+
import './dep-a.ts';
3+
4+
export function b() { /* ... */ }
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": [
3+
"import"
4+
],
5+
"rules": {
6+
"import/no-cycle": "error"
7+
}
8+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// should report cycle detected
2+
import { b } from './folder-dep-b.ts';
3+
4+
b();

0 commit comments

Comments
 (0)