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 toPipe and fromPipe commands #182

Merged
merged 9 commits into from
Dec 14, 2021

Conversation

polvalente
Copy link
Contributor

@polvalente polvalente commented Apr 2, 2021

Adds support for the commands defined in elixir-lsp/elixir-ls#515, keeping the fixes in elixir-lsp/elixir-ls#520 in mind

@@ -408,7 +416,15 @@
},
{
"command": "extension.expandMacro",
"title": "editorLangId == elixir"
"when": "editorLangId == elixir || editorLangId == eex || editorLangId == html-eex"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at line 415, this seemed to need a fix

@polvalente
Copy link
Contributor Author

@axelson @lukaszsamson any tips on how to test this locally with the unreleased changes in ElixirLS? Should I just compile the LS and copy the files over to the local extension build for said test?

@lukaszsamson
Copy link
Collaborator

@polvalente I think there was a section in the readme some time ago. Maybe it was in the original Jake's repo. Open this repo in vscode and run debug with launch profile: Launch extension. It should build and release elixir-LS from submodule and launch a new debug vscode window.

@axelson
Copy link
Member

axelson commented Apr 2, 2021

Should I just compile the LS and copy the files over to the local extension build for said test?

This is what I usually do. It looks something like mix elixir_ls.release -o ~/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.6.2/elixir-ls-release (although I'm using the open source version of VSCode).

@polvalente
Copy link
Contributor Author

Should I just compile the LS and copy the files over to the local extension build for said test?

This is what I usually do. It looks something like mix elixir_ls.release -o ~/.vscode-oss/extensions/elixir-lsp.elixir-ls-0.6.2/elixir-ls-release (although I'm using the open source version of VSCode).

Thanks! I've already tested and opened another fix on elixir-ls (elixir-lsp/elixir-ls#521). It seems everything is working as expected, but there is a problem with sigils when there are \ characters present (more details in the elixir-ls PR)

src/extension.ts Outdated
return;
}

const uri = editor.document.uri;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This client retrieval is a common part of custom commands and could be extracted into a function

src/extension.ts Outdated
}
}

interface ManipulatePipesResponse {
Copy link
Collaborator

Choose a reason for hiding this comment

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

interface not used

@polvalente
Copy link
Contributor Author

@lukaszsamson Sorry this took so long. PR is now ready for review again. One caveat is that ElixirLS needs to be updated in the submodule for this to work properly. I haven't committed this in this PR, but it'll be a necessary fix before releasing this feature :)

const disposable = vscode.commands.registerCommand(commandName, async () => {
const extension = vscode.extensions.getExtension("jakebecker.elixir-ls");
const editor = vscode.window.activeTextEditor;
if (!extension || !editor) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the extension check necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not exactly, this just fails faster upon a bizarre error, if that makes sense. I can remove it if you prefer

@lukaszsamson
Copy link
Collaborator

@polvalente can you resolve merge conflicts?

@polvalente
Copy link
Contributor Author

@lukaszsamson done. I did it through the web interface, so hopefully I didn't break the code. Please @ me if there are any problems!

@lukaszsamson lukaszsamson merged commit 346bb97 into elixir-lsp:master Dec 14, 2021
@mhanberg
Copy link

Sorry for commenting on an old PR, but are these command supposed to show up in the command palette? These are the only ones I'm seeing

image

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.

4 participants