GithubHelp home page GithubHelp logo

Comments (6)

lifeart avatar lifeart commented on August 16, 2024 1

I think we can start from simpler promise-based subprocess api (to have async/await syntax), without extra de-bounce/queue and figure out more complex path if needed.

avg rate is about 4-8rps

from ember-language-server.

saravanak avatar saravanak commented on August 16, 2024

Had a look on this, the reason is that the template file (and its footprint) is cached in two locations

  • one inside the _linterCache in template_linter.js file and
  • two, by the node's require cache.

I evicted (1) by deleting the cache entry on the onDidChangeContent on the document listener , when a ember-cli-build.js file.
But for (2), the only way to evict is probably doing a delete require.cache[...] or by using a library (decache ?) for it

I tried to emulate the CLIEngine way of eslint, but the exports in get_config.js have changed quite a bit, so not sure if we can reliably create a wrapper similar to CLIEngine for ember-template-lint

What are your thoughts on this @lifeart

from ember-language-server.

lifeart avatar lifeart commented on August 16, 2024

looks like resolved config cached inside template-lint itself https://github.com/ember-template-lint/ember-template-lint/blob/e17ac93f43f3aed3c16f734ee87c84c52d65dfcc/lib/get-config.js#L481, by require in resolveProjectConfig.

and we can follow few options:

  • discover & read config manually and add it into linter constrictor, in this case we can fully controll config behavour
  • run linter inside fork process (it will fix CWD issue & config caching issues)

@saravanak, @NullVoxPopuli I would prefer to try run linter in new node process, any conserns?

from ember-language-server.

saravanak avatar saravanak commented on August 16, 2024

I am for

run linter inside fork process

I think that if we follow a de-bounced aggregation of the files changed, and then fork the linter (for that set of files), it would be great. I saw some references in vscode-eslint, and they have an internal queue that is being used for the linting process.

https://github.com/microsoft/vscode-eslint/blob/e0f67ac57e757aeb48017b8da6667123c0dc5cff/server/src/eslintServer.ts#L866

Can we use a similar approach here? Also not sure of the rate of change of files from the onDidChangeContent callback for standard editor actions.

from ember-language-server.

lifeart avatar lifeart commented on August 16, 2024

in future, we can introduce debounce in this place: https://github.com/lifeart/ember-language-server/blob/component-context-info-origin/src/server.ts#L368, but I think we need to check debounce-less implementation first

from ember-language-server.

lifeart avatar lifeart commented on August 16, 2024

https://github.com/piscinajs/piscina may be used
https://github.com/mantoni/eslint_d.js
https://github.com/sindresorhus/execa

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.