Comments (13)
For your information, it's now working perfectly for me (on my 2 computers) with v0.1.0
from vscode-sqlfluff.
Please update to v0.0.6 and let me know if the problem is still occurring.
from vscode-sqlfluff.
Hi @RobertOstermann ,
I'm posting here since my latest comment was probably made under an irrelevant issue.
--
My colleagues using Windows have troubles to make our sqlfluff setup working even-though they are using v0.0.6.
I see that they are not alone by looking at the current issue, and to some other tickets (here or here).
As @reubster we think the issue relates to setting of the executable path. We have tried several paths and here is our latest settings.json
.
{
"workbench.colorTheme": "Default Dark+",
"files.associations": {
"*.sql": "jinja-sql"
},
"editor.bracketPairColorization.enabled": true,
"diffEditor.ignoreTrimWhitespace": false,
"sql.linter.executablePath": "C:/Anaconda/Scripts/sqlfluff",
"sqlfluff.executablePath": "C:/Anaconda/Scripts/sqlfluff",
"sqlfluff.linter.run": "onSave",
"githubPullRequests.pullBranch": "never",
"sqlfluff.config": ".sqlfulff",
"sqlfluff.dialect": "bigquery",
"sqlfluff.ignoreLocalConfig": true,
"editor.rulers": [80],
"sqlfluff.excludeRules": [
]
}
For the path, we tried several variations and got errors in the Dev Console, or as a warning popup in VScode.
C:\\Anaconda\\Scripts\\sqlfluff
C:/Anaconda/Scripts/sqlfluff
Resulted in an error in the dev console
workbench.desktop.main.js:86 [Extension Host] SyntaxError: Unexpected token E in JSON at position 0
at JSON.parse (<anonymous>)
at c:\Users\pguillotte\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.6\out\src\extension.js:3:4751
at Array.forEach (<anonymous>)
at L.process (c:\Users\pguillotte\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.6\out\src\extension.js:3:4722)
at Socket.a (c:\Users\pguillotte\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.6\out\src\extension.js:3:3611)
at Socket.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
/c/Anaconda/Scripts/sqlfluff
Resulted in a warning message in VSCode saying the executable was not found.
Cannot lint path/to/file . The executable was not found. Use the 'Executable Path' setting to configure the location of the executable.
--
I know it's probably an issue unrelated to SQLfluff per se, but would you have any advice to fix the path to the executable issue?
from vscode-sqlfluff.
Are you sure that the right Python environment is selected in vs Code?
from vscode-sqlfluff.
I'm not sure which environment is the good one, but for the previously mentioned case, the only available interpreter is C:\Anaconda\python.exe
from vscode-sqlfluff.
I think this is a problem with the extension reading the JSON response from the sqlfluff linter. Can you check the output for the command sqlfluff lint --format json {other arguments and filename}
when run on the file/files you are having issues with? That should give you a JSON response and you could check if the response is a valid JSON string or not.
from vscode-sqlfluff.
Hello @RobertOstermann ! I'm @tanzaho 's colleague having the issue with the SQL Fluff extension on VS Code (Windows).
The JSON I get using your method is the following :
[{"filepath": "models\\marts\\core\\fct_ads.sql", "violations": [{"line_no": 6, "line_pos": 82, "code": "L001", "description": "Unnecessary trailing whitespace."}, {"line_no": 6, "line_pos": 83, "code": "L016", "description": "Line is too long."}, {"line_no": 13, "line_pos": 7, "code": "L010", "description": "Keywords must be lower case."}]}]
which looks like a valid JSON when checked using a validator. Maybe the problem is elsewhere ? The \\
in the path seems a bit suspicious
from vscode-sqlfluff.
@PaulGuillotte I have recently released v0.0.7 which replaces the \\
with /
and hopefully helps fix your issue. Give that version a try and let me know if it works.
from vscode-sqlfluff.
Thanks for your answer !
Unfortunately, I've got the same JSON with the 0.0.7, with the \\
in the path.
from vscode-sqlfluff.
So you are still getting this error in the dev console after the update? You should be using one of these two paths.
C:\\Anaconda\\Scripts\\sqlfluff
C:/Anaconda/Scripts/sqlfluff
workbench.desktop.main.js:86 [Extension Host] SyntaxError: Unexpected token E in JSON at position 0
at JSON.parse (<anonymous>)
at c:\Users\pguillotte\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.6\out\src\extension.js:3:4751
at Array.forEach (<anonymous>)
at L.process (c:\Users\pguillotte\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.6\out\src\extension.js:3:4722)
at Socket.a (c:\Users\pguillotte\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.6\out\src\extension.js:3:3611)
at Socket.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
from vscode-sqlfluff.
Yes, I tried with both paths you mentionned and in both cases I've got he same error in the dev console, which is the one you pasted above.
For your information, i'm also trying on another computer with a different error.
Computer 1 : Not working with the parameter templater = dbt
or templater = jinja
, getting the Unexpected token E in JSON at position 0
in the console
Computer 2 : Working with templater = jinja
, but getting an error with templater = dbt
which is :
Error: Illegal argument: line must be non-negative
at k (c:\Users\paulg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:7:1279)
at new g (c:\Users\paulg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:78:87257)
at new g (c:\Users\paulg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:78:86652)
at new c (c:\Users\paulg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:78:89354)
at new c (c:\Users\paulg\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:78:86652)
at c:\Users\paulg\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.7\out\src\extension.js:3:4876
at Array.forEach (<anonymous>)
at c:\Users\paulg\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.7\out\src\extension.js:3:4841
at Array.forEach (<anonymous>)
at c:\Users\paulg\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.7\out\src\extension.js:3:4816
at Array.forEach (<anonymous>)
at L.process (c:\Users\paulg\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.7\out\src\extension.js:3:4724)
at Socket.l (c:\Users\paulg\.vscode\extensions\dorzey.vscode-sqlfluff-0.0.7\out\src\extension.js:3:3613)
at Socket.emit (node:events:402:35)
at endReadableNT (node:internal/streams/readable:1343:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)```
from vscode-sqlfluff.
Ok, I am out of ideas. If you wanted to pull down this repo and debug the problem yourself you might have some luck. I'll throw on the help wanted tag and maybe someone else will have more knowledge of how to solve this problem.
from vscode-sqlfluff.
Closing this issue. For any other problems, please create a new issue.
from vscode-sqlfluff.
Related Issues (20)
- Not specifying a SQL Dialect in extension settings leads to confusing error HOT 1
- Environment variables cannot be passed to extension
- VS code SQL editor marks problems but running SQLFluff via terminal doesn't detect problems
- vscode format on save errors due to future deprecation
- `sqlfluff 3.0` release breaks extension `sql` document formatter HOT 5
- OSError: [Errno 6] Device not configured: '/dev/tty' HOT 4
- No documentation or examples for how to override defaults for rules or rule groups HOT 2
- `Format Document` or `SQLFluff: Fix` overwrites file contents with sqlfluff logs HOT 4
- Can't find the sqlfluff.exe file after installation HOT 6
- [Feature] Show rule name in `Problems` tab HOT 2
- Unable to lint non `.sql` files HOT 1
- WSL - Executable not found HOT 2
- Extension doesn't respect warnings from sqlfluff output
- What is the syntax for adding rules? HOT 3
- Command 'Format Document With...' resulted in an error HOT 1
- Can config custom .sqlfluffignore file ?
- ERROR: Starting in sqlfluff version 0.7.0 the dbt templater is distributed as a separate python package. Please pip install sqlfluff-templater-dbt to use it. HOT 1
- Auto Detect SqlFlulf executable from Python Virtual Environment HOT 1
- "File path not found" when working on unsaved files HOT 1
- Issue with semvar comparison HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-sqlfluff.