atom / ide-typescript

TypeScript and Javascript language support for Atom-IDE
MIT License
368 stars 63 forks source link

Expand activation scopes #152

Closed Aerijo closed 5 years ago

Aerijo commented 5 years ago

103 was meant to stop this package loading unnecessarily, but it only supported the core JS / TS grammar packages.

This changes the event hooks to be root scope based, which should cover all standard JS(X) and TS(X) grammar root scope names (I compared against the core packages + language-babel, and it matches the extended scopes section too). As Tree-sitter has settled down, there should be no risk of different scope conventions.

Alternative designs

We could simply revert #103. I've seen varying reported values from time-cop, and it often seems to depend on the order packages happen to load in. Having said that, all my installed ide- packages consistently get reported among the biggest time sinks.

closes #151

Aerijo commented 5 years ago

An even better way of checking the scopes are right is looking at the server's declared scopes

const jsScopes = ['source.js', 'source.js.jsx', 'javascript']
const tsScopes = ['source.ts', 'source.tsx', 'typescript']

so they match (and shows it needs a PR to remove the early Tree-sitter scopes)