GithubHelp home page GithubHelp logo

Comments (7)

lifeart avatar lifeart commented on June 19, 2024

@jackson-dean you need to get vscode-ember package, and link it to local ember-language-server version.

vscode-ember has start-vscode script.

Most relevant Go-to component definitions examples in #173 (https://marketplace.visualstudio.com/items?itemName=lifeart.vscode-ember-unstable)

  • Don't forget to compile ember-language-server code (ts -> js) before start-vscode

from ember-language-server.

ppcano avatar ppcano commented on June 19, 2024

@lifeart Thank you for working and making available Unstable Ember Language Server.

I think go to definition for absolute paths on JS modules could be one of the most important features to include.

All my JS modules are imported with the application name as the namespace root name.

import myModule from 'li/utils/my-module';

If I am not wrong, that is or was an Ember requirement.

Making this feature available will allow navigating easily across all the app JS modules.

from ember-language-server.

lifeart avatar lifeart commented on June 19, 2024

@ppcano it's definetly possible, all we need is - write kinda resolution logic for it.

1.) for absolute paths
-- fo/bar/baz
-> appName/app/foo/bar/baz
-> node_modules/addon_name/app/foo/bar/baz
(in-repo addon, node-modules addon, local import)
2.) for relative paths

if you have time for it, you can add resolution logic to
https://github.com/lifeart/ember-meta-explorer/blob/master/src/utils/lookup-utils.ts

resolveScriptImport(appRoot, filePath, importDeclaration)
resolveScriptImport('/home/my-ember', '/home/my-ember/app/utils/util.js', 'li/utils/my-module')

from ember-language-server.

lifeart avatar lifeart commented on June 19, 2024

@ppcano go-to definition for absolute imports commited to branch, could you test it?

from ember-language-server.

ppcano avatar ppcano commented on June 19, 2024

@lifeart I have tried but it does not look to be working.

I think I am using correctly your branch.

> clone ember-language-server 
cd ember-language-server
> move to  your branch
yarn install
yarn link
yarn compile

cd ..
> clone vscode-ember
cd vscode-ember
yarn install
yarn link "@emberwatch/ember-language-server"
yarn compile
./start-vscode.sh

Language server is working because component and helper autocompletion on handlebars works.

Please, let me know if I should try something else.

Note: I think the above instructions or another description explaining how to run locally the project may be useful to add on the Readme or Contribution section.

from ember-language-server.

jackson-dean avatar jackson-dean commented on June 19, 2024

For the js side of the resolution I discovered it can be done pretty easily using a proper jsconfig.json which uses the ts/js language server packaged with VSCode. Resolving namespaced component invocations would be very valuable though.

from ember-language-server.

lifeart avatar lifeart commented on June 19, 2024

@jackson-dean it's should work in unstable-language-server

from ember-language-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.