Comments (6)
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.
Had a look on this, the reason is that the template file (and its footprint) is cached in two locations
- one inside the
_linterCache
intemplate_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.
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.
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.
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.
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.
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)
- What's the difference between this fork and the original repo? HOT 3
- add basic template-imports support HOT 1
- improve embeeded langs support
- Quest: Template imports support
- Builtin VSCode ls integrations
- feature request: folding provider
- Respect projectRoot field in ember-addon HOT 1
- Autocomplete support for `...attributes` HOT 1
- Autocomplete support for `key` argument of `{{#each}}` helper HOT 1
- Renaming HOT 5
- moduleName support
- yield arguments hash autocomplete
- monorepo template lint support HOT 10
- named blocks yield arguments autocomplete HOT 1
- assets autocomplete for src attribute and @src argument
- Add all supported yaml extensions for intl functionality
- [FEATURE] Autocomplete event names for `on` modifier HOT 3
- Auto-closing `{{#if}}`, `{{#let}}`, `{{#each}}`, etc. HOT 1
- Support `ember` key in package.json (instead of `ember-addon`)
- ember-template-lint v5 support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-language-server.