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

Implement ElixirSense. #67

Merged
merged 12 commits into from
Jun 7, 2017
Merged

Implement ElixirSense. #67

merged 12 commits into from
Jun 7, 2017

Conversation

potterdai
Copy link
Contributor

@potterdai potterdai commented Jun 3, 2017

-Implement ElixirSense.
-Add SignatureHelpProvider.
-Upgrade VSCode and Typescript version.

@timmhirsens
Copy link
Owner

Woah, awesome! Gonna check this PR later today. Thank you very much!

Copy link
Owner

@timmhirsens timmhirsens left a comment

Choose a reason for hiding this comment

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

Looks good to me, despite a few minor issues.
Do you mind fixing those? Otherwise I would do that myself after merging.

@@ -21,7 +21,7 @@
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["out/test"],
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
"preLaunchTask": "npm"
}
Copy link
Owner

Choose a reason for hiding this comment

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

Formatting

@@ -5,6 +5,5 @@
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Any reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, this is overwritten by autogenerated file from latest yeoman.
I just added it back. = )

@@ -23,7 +23,7 @@
"args": ["run", "compile", "--loglevel", "silent"],

// The tsc compiler is started in watching mode
"isWatching": true,
"isBackground": true,

Copy link
Owner

Choose a reason for hiding this comment

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

Formatting?

}
});
*/

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe delete this?

}
});
*/

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe delete this?

@potterdai
Copy link
Contributor Author

Hi, just did all the follow up cleanings and changes.
The code was done in a bit rush last week so it lacks a bit cleaning, now it should be good.
Please report if there is any errors. Thank you! = )

@timmhirsens
Copy link
Owner

Okay, the Code is looking fine now ;-)

Hower I am having issues getting this to run. I checked out your changes, inited the submodule and did a clean npm install. I keep getting this error:

[vscode-elixir] Cannot decode Erlang term: <<131,116,0,0,0,3,119,5,101,114,114,111,114,119,3,110,105,108,119,7,112,97,121,108,111,97,100,116,0,0,0,3,119,14,97,99,116,117,97,108,95,115,117,98,106,101,99,116,109,0,0,0,8,67,97,104,46,71,97,109,101,119,4,100,111,99,115,116,0,0,0,3,119,9,99,97,108,108,98,97,99,107,115,109,0,0,0,0,119,4,100,111,99,115,109,0,0,0,26,78,111,32,100,111,99,117,109,101,110,116,97,116,105,111,110,32,97,118,97,105,108,97,98,108,101,119,5,116,121,112,101,115,109,0,0,0,0,119,7,115,117,98,106,101,99,116,109,0,0,0,8,67,97,104,46,71,97,109,101,119,10,114,101,113,117,101,115,116,95,105,100,97,6>>
Reason: RangeError: Offset is outside the bounds of the DataView
    at DataView.getUint8 (<anonymous>)
    at _decodeAtom (/home/timm/projects/vscode-elixir/out/src/jem.js:74:39)
    at _decodeObject (/home/timm/projects/vscode-elixir/out/src/jem.js:112:24)
    at _decodeValue (/home/timm/projects/vscode-elixir/out/src/jem.js:55:20)
    at Object.decode (/home/timm/projects/vscode-elixir/out/src/jem.js:18:16)
    at ElixirSenseClient.readPacket (/home/timm/projects/vscode-elixir/out/src/elixirSenseClient.js:58:30)
    at ElixirSenseClient.handleData (/home/timm/projects/vscode-elixir/out/src/elixirSenseClient.js:39:18)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)

Am I missing anything here?

@potterdai
Copy link
Contributor Author

Hey, just decoded the Erlang term, the problem seems at jem.ts.
It's weird at my place all projects works fine.
Did you try with another project? Is the result the same?

@potterdai
Copy link
Contributor Author

Fixed!
The bug is that the code I took from jem.js(https://github.com/inaka/jem.js) ignores atom type 118 and 119. Just fixed here, and I think I should make a pull request there as well = ).

@timmhirsens
Copy link
Owner

Yes, that bug seems fixed, great work!

I am going to compare both versions for a bit now, before i merge this.

@timmhirsens
Copy link
Owner

This seems to work really well, and I like the added Parameter Help!

Going to merge this now and publish a release later today / this week.

Again, thank you very (!) much for your contribution!

@timmhirsens timmhirsens merged commit aa10165 into timmhirsens:master Jun 7, 2017
@timmhirsens timmhirsens mentioned this pull request Jun 7, 2017
@potterdai
Copy link
Contributor Author

Sure!
Also just a remind, please add the new configurations to the README file when do the publish.
https://github.com/fr1zle/vscode-elixir/blob/master/package.json#L148
Just in case somebody still prefer the original alchemist-server version, they can switch quite easily.

@msaraiva
Copy link

msaraiva commented Jun 9, 2017

@potterdai @fr1zle Great job! It would be really nice if we could have a centralized repo for the customized jem.js and elixir-sense-client.js. This way, changes like this could benefit any JS based editor (like Atom). I guess we could have those two files in the elixir_sense project. We could then configure a package.json so we can publish it as an npm package. What do you think?

BTW. We could also include all needed .ex and .exs in the package. This way client and server files will always be in sync and we won't have to copy those files manually anymore ;)

@potterdai
Copy link
Contributor Author

@msaraiva Sure, that's a great idea!
Could you create a new repo for jem.js and elixir-sense-client.js? Then I can make a pull request for the revised version of jem.js .

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.

3 participants