Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
38 stars 3 forks source link

Unable to get this working. #12

Closed sunscreem closed 2 years ago

sunscreem commented 3 years ago

I've installed the plug in, restarted VS code and its generated an .antlers.json file and added some files to storage.

In my templates though I'm not seeing anything different:

image

If I turn on the logging I can see things happening as I type:

[Trace - 12:33:19 PM] Sending notification 'textDocument/didChange'.
[Trace - 12:33:19 PM] Sending request 'textDocument/foldingRange - (200)'.
[Trace - 12:33:19 PM] Received notification '$/progress'.
[Trace - 12:33:19 PM] Received notification '$/progress'.
[Trace - 12:33:19 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 12:33:19 PM] Received response 'textDocument/foldingRange - (200)' in 77ms.
[Trace - 12:33:22 PM] Sending request 'textDocument/hover - (201)'.
[Trace - 12:33:22 PM] Received response 'textDocument/hover - (201)' in 3ms.
[Trace - 12:33:23 PM] Sending notification 'textDocument/didChange'.
[Trace - 12:33:23 PM] Sending request 'textDocument/completion - (202)'.
[Trace - 12:33:23 PM] Received notification '$/progress'.
[Trace - 12:33:23 PM] Received notification '$/progress'.
[Trace - 12:33:23 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 12:33:23 PM] Received response 'textDocument/completion - (202)' in 67ms.
[Trace - 12:33:23 PM] Sending notification 'textDocument/didChange'.
[Trace - 12:33:23 PM] Sending request 'textDocument/foldingRange - (203)'.
[Trace - 12:33:23 PM] Received notification '$/progress'.
[Trace - 12:33:23 PM] Received notification '$/progress'.
[Trace - 12:33:23 PM] Received notification 'textDocument/publishDiagnostics'.
[Trace - 12:33:23 PM] Received response 'textDocument/foldingRange - (203)' in 58ms.

99% chance I'm being dumb here.

I use a remote workspace (via ssh). Could that be the issue?

JohnathonKoster commented 3 years ago

The Antlers completions will normally only get triggered when inside {{ }} regions. Outside of those areas, the HTML/CSS/etc suggestions take over :)

sunscreem commented 3 years ago

Thanks John.

It's not working inside in the {{ }}. The problem is I'm an idiot and took the screen grab incorrectly - sorry about that. Here's a better one. I was expecting to see it suggest partial? Maybe I'm not understanding the plug in?

image

JohnathonKoster commented 3 years ago

It should work like how you have it (sometimes it doesn't place nice with Emmet, though) - does the language in the bottom right corner of VS Code say HTML (Statamic Antlers)?

sunscreem commented 3 years ago

It does John yes:

image

Sorry - badly cropped.

JohnathonKoster commented 3 years ago

No worries; thanks for checking!

Seems like we are getting closer to bug territory - could you send your install's emmet configuration, as well as a list of all installed VS Code extensions?

Thank you!

sunscreem commented 3 years ago

Sorry for the delay @JohnathonKoster

Local extensions - ahdesign.language-antlers@0.1.0 - CoenraadS.bracket-pair-colorizer@1.0.61 - csstools.postcss@1.0.9 - daylerees.rainglow@1.5.2 - formulahendry.auto-rename-tag@0.1.8 - mikestead.dotenv@1.0.1 - ms-vscode-remote.remote-containers@0.187.1 - ms-vscode-remote.remote-ssh@0.65.7 - ms-vscode-remote.remote-ssh-edit@0.65.7 - ms-vscode-remote.remote-wsl@0.58.2 - ms-vscode-remote.vscode-remote-extensionpack@0.21.0 - ms-vscode.sublime-keybindings@4.0.9 - neilding.language-liquid@0.1.1 - Shan.code-settings-sync@3.4.3 - vscode-icons-team.vscode-icons@11.6.0 - wayou.vscode-todo-highlight@1.0.4
Extensions installed on my remote linux server - bmewburn.vscode-intelephense-client@1.7.1 - bradlc.vscode-tailwindcss@0.6.13 - calebporzio.better-phpunit@1.5.3 - cweijan.vscode-office@2.4.0 - dbaeumer.vscode-eslint@2.1.23 - esbenp.prettier-vscode@8.1.0 - heybourn.headwind@1.7.0 - kotfire.php-add-property@1.1.0 - mblode.twig-language@0.9.2 - mblode.twig-language-2@0.9.2 - mrmlnc.vscode-duplicate@1.2.1 - ms-dotnettools.vscode-dotnet-runtime@1.2.0 - ms-mssql.mssql@1.10.1 - mutantdino.resourcemonitor@1.0.7 - octref.vetur@0.34.1 - onecentlin.laravel-blade@1.25.0 - pflannery.vscode-versionlens@1.0.9 - rvest.vs-code-prettier-eslint@3.0.4 - shufo.vscode-blade-formatter@0.7.21 - stillat-llc.vscode-antlers@1.0.22 - streetsidesoftware.code-spell-checker@1.10.2 - stripe.vscode-stripe@2.0.3 - syler.sass-indented@1.8.17

Emmet Config (from settings.json):

    "emmet.triggerExpansionOnTab": true,
    "emmet.includeLanguages": {
        "javascript": "javascriptreact",
        "vue-html": "html",
        "twig": "html",
        "razor": "html",
        "plaintext": "jade",
        "vue": "vue"
    },
    "tailwindCSS.emmetCompletions": true,
JohnathonKoster commented 3 years ago

Can you try uninstalling the ahdesign.language-antlers@0.1.0 extension and restarting VS Code?

The two extensions are not compatible with each other, and that one may prevent the required language client from starting.

sunscreem commented 3 years ago

@JohnathonKoster Sorry for the crazy slow reply on this. I think I have it working now.

I turned on verbose logging with the antlers language server and noticed references to liquid!? I disabled any extensions I've been using for shopify development and it now seems to be playing ball.

If I type {{ partial: for example its offers to autocomplete :)

I also not it created a .antlers.json file now.