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

feat: add sqruff as a VSCode extension #369

Merged
merged 8 commits into from
Jun 16, 2024
Merged

feat: add sqruff as a VSCode extension #369

merged 8 commits into from
Jun 16, 2024

Conversation

gvozdvmozgu
Copy link
Collaborator

No description provided.

Copy link

Benchmark for 8b0ce87

Click to view benchmark
Test Base PR %
DepthMap::from_parent 209.6±2.20µs 210.4±4.31µs +0.38%
fix_complex_query 21.6±0.13ms 21.6±0.10ms 0.00%
parse_complex_query 266.6±6.30µs 271.5±6.74µs +1.84%
parse_expression_recursion 295.5±9.38µs 298.2±7.54µs +0.91%
parse_simple_query 256.2±5.62µs 259.4±11.99µs +1.25%

Copy link

Benchmark for a07c3ef

Click to view benchmark
Test Base PR %
DepthMap::from_parent 213.4±4.23µs 209.1±3.40µs -2.01%
fix_complex_query 21.6±0.10ms 21.7±0.30ms +0.46%
parse_complex_query 271.9±6.16µs 271.9±7.80µs 0.00%
parse_expression_recursion 291.2±5.15µs 299.3±6.65µs +2.78%
parse_simple_query 251.4±5.64µs 254.8±10.82µs +1.35%

@benfdking benfdking linked an issue Jun 13, 2024 that may be closed by this pull request
12 tasks
@gvozdvmozgu gvozdvmozgu force-pushed the vscode branch 2 times, most recently from 9276efa to 631b9e6 Compare June 14, 2024 07:58
Copy link

Benchmark for fbe7902

Click to view benchmark
Test Base PR %
DepthMap::from_parent 208.5±3.13µs 210.5±7.21µs +0.96%
fix_complex_query 21.6±0.36ms 21.7±0.05ms +0.46%
parse_complex_query 273.6±6.00µs 264.6±5.32µs -3.29%
parse_expression_recursion 294.7±6.24µs 293.9±5.19µs -0.27%
parse_simple_query 259.5±6.44µs 254.3±11.07µs -2.00%

Copy link

Benchmark for b1ae0cd

Click to view benchmark
Test Base PR %
DepthMap::from_parent 208.9±2.01µs 209.2±3.79µs +0.14%
fix_complex_query 21.6±0.19ms 21.8±0.77ms +0.93%
parse_complex_query 268.5±4.52µs 266.4±6.54µs -0.78%
parse_expression_recursion 294.1±5.82µs 294.4±5.86µs +0.10%
parse_simple_query 256.3±10.31µs 258.8±16.05µs +0.98%

Copy link

Benchmark for cc1d967

Click to view benchmark
Test Base PR %
DepthMap::from_parent 212.2±1.94µs 210.3±5.73µs -0.90%
fix_complex_query 21.6±0.43ms 21.7±0.27ms +0.46%
parse_complex_query 275.0±5.79µs 267.7±6.23µs -2.65%
parse_expression_recursion 301.6±5.14µs 296.6±6.00µs -1.66%
parse_simple_query 261.8±4.86µs 258.2±11.26µs -1.38%

Copy link

Benchmark for b8cbdd2

Click to view benchmark
Test Base PR %
DepthMap::from_parent 209.5±3.67µs 208.7±5.50µs -0.38%
fix_complex_query 21.7±0.07ms 21.7±0.07ms 0.00%
parse_complex_query 263.4±8.44µs 275.8±5.58µs +4.71%
parse_expression_recursion 291.8±5.18µs 297.3±7.02µs +1.88%
parse_simple_query 252.9±7.18µs 257.7±7.50µs +1.90%

@gvozdvmozgu gvozdvmozgu marked this pull request as ready for review June 15, 2024 02:27
@gvozdvmozgu gvozdvmozgu requested a review from benfdking June 15, 2024 02:27
Copy link

Benchmark for c89602f

Click to view benchmark
Test Base PR %
DepthMap::from_parent 211.2±16.54µs 207.2±2.44µs -1.89%
fix_complex_query 21.6±0.10ms 21.8±0.08ms +0.93%
parse_complex_query 271.5±3.57µs 277.6±7.05µs +2.25%
parse_expression_recursion 299.4±4.73µs 307.3±6.85µs +2.64%
parse_simple_query 258.9±6.12µs 263.2±8.87µs +1.66%

Copy link

Benchmark for 6e0da46

Click to view benchmark
Test Base PR %
DepthMap::from_parent 208.2±3.29µs 225.4±4.55µs +8.26%
fix_complex_query 21.6±0.28ms 21.7±0.20ms +0.46%
parse_complex_query 268.6±4.78µs 271.9±9.08µs +1.23%
parse_expression_recursion 295.6±7.37µs 295.4±4.30µs -0.07%
parse_simple_query 256.9±6.24µs 256.8±8.15µs -0.04%

Copy link

Benchmark for da250be

Click to view benchmark
Test Base PR %
DepthMap::from_parent 206.2±2.28µs 208.3±2.21µs +1.02%
fix_complex_query 21.7±0.85ms 21.9±0.84ms +0.92%
parse_complex_query 269.7±5.89µs 276.7±4.79µs +2.60%
parse_expression_recursion 297.9±12.31µs 305.5±5.26µs +2.55%
parse_simple_query 260.9±7.16µs 264.3±9.73µs +1.30%

Copy link

Benchmark for 14206c7

Click to view benchmark
Test Base PR %
DepthMap::from_parent 210.4±3.20µs 210.3±4.34µs -0.05%
fix_complex_query 21.5±0.26ms 21.5±0.06ms 0.00%
parse_complex_query 264.3±5.19µs 276.9±13.32µs +4.77%
parse_expression_recursion 299.1±5.93µs 297.8±5.59µs -0.43%
parse_simple_query 256.9±7.00µs 268.9±9.86µs +4.67%

Copy link
Collaborator

@benfdking benfdking left a comment

Choose a reason for hiding this comment

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

Hey @gvozdvmozgu,

Great work, I am just wondering, I am struggling to get it to work in browser, what are the steps that you have run to test/run it?

editors/code/package.json Outdated Show resolved Hide resolved
Comment on lines +4 to +19
export function activate(context: vscode.ExtensionContext) {
const serverMain = vscode.Uri.joinPath(
context.extensionUri,
"dist/browserServerMain.js",
);

const worker = new Worker(serverMain.toString(true));
worker.onmessage = (message) => {
if (message.data !== "OK") {
return;
}

const cl = new LanguageClient("sqruff-lsp", "Sqruff LSP", { documentSelector: [{ language: "sql" }] }, worker);
cl.start().then(() => { });
};
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am struggling to see how you are testing this in the browser. Did you run npm run run-in-browser? and what before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

npm run build:wasm_lsp && npm run compile && npm run run-in-browser

editors/code/tsconfig.json Outdated Show resolved Hide resolved
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "Node16",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: This here feels slightly odd version but not important.

Comment on lines +14 to +15
with:
push_options: '--force'
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: we should add some CI checks for this as well.

Copy link

Benchmark for 36de1b5

Click to view benchmark
Test Base PR %
DepthMap::from_parent 209.2±3.29µs 209.8±3.13µs +0.29%
fix_complex_query 21.6±0.07ms 21.6±0.17ms 0.00%
parse_complex_query 272.5±3.86µs 270.4±4.97µs -0.77%
parse_expression_recursion 299.0±4.47µs 295.6±5.34µs -1.14%
parse_simple_query 260.3±7.81µs 257.1±10.60µs -1.23%

Copy link

Benchmark for bde5b91

Click to view benchmark
Test Base PR %
DepthMap::from_parent 206.6±1.86µs 210.1±2.34µs +1.69%
fix_complex_query 21.7±0.36ms 21.7±0.15ms 0.00%
parse_complex_query 274.3±5.20µs 272.4±5.68µs -0.69%
parse_expression_recursion 306.0±5.17µs 297.4±6.93µs -2.81%
parse_simple_query 262.4±6.31µs 263.9±11.60µs +0.57%

@benfdking
Copy link
Collaborator

I think there are a few things we should improve, but in the meantime, we should merge this:

  • CI System to run and check this
    • Build and lint
  • CI System that deploys this
  • I do think we should register a formatter which this doesn't yet accomplish
  • Document well how to run this locally

@benfdking benfdking merged commit 089654f into main Jun 16, 2024
9 checks passed
@benfdking benfdking deleted the vscode branch June 16, 2024 18:12
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.

VS Code extension
2 participants