Giter VIP home page Giter VIP logo

Comments (10)

lierdakil avatar lierdakil commented on July 17, 2024 1

Any updates?

from language-typescript.

Nxt3 avatar Nxt3 commented on July 17, 2024

This also happens with other Typescript scopes: https://discuss.atom.io/t/cant-seem-to-style-element-based-on-cursor-scope/51526

from language-typescript.

lierdakil avatar lierdakil commented on July 17, 2024

Bump. Is anyone actually responsible for this project at the moment?

from language-typescript.

damieng avatar damieng commented on July 17, 2024

@lierdakil The team was on a bug bash and retreat last month so we are somewhat behind on triage.

from language-typescript.

damieng avatar damieng commented on July 17, 2024

The grammar comes from upstream and is supposed to work in a variety of editors - from their README;

This repository contains TmLanguage files that are consumed by TypeScript editors and plugins such as Visual Studio Code, The TypeScript Sublime Plugin, Atom TypeScript, and possibly others.

I'm not aware that any other editor can handle spaces in the names correctly besides VSCode so either that upstream repository isn't the one we all want to use after all or they need to consider not closing the issue with "works in VSCode" :(

from language-typescript.

lierdakil avatar lierdakil commented on July 17, 2024

FWIW, Sublime seems to handle it correctly:
image
while in Atom it's
image
when it should be
image

(I'm not familiar enough with Sublime to make any informed claims, but it seems that it just uses whitespace as a scope delimiter, so if grammar yields a scope with whitespace, Sublime just treats that as two scopes)

from language-typescript.

lierdakil avatar lierdakil commented on July 17, 2024

Might it might be easier to fix on Atom side?.. At least I believe a quick fix should amount to a single-line change (didn't look at the sources yet though, so allow for a ± couple lines). A "correct" fix might prove to be a bit more involved, but probably not drammatically so.

from language-typescript.

damieng avatar damieng commented on July 17, 2024

The problem is if I hack the grammar files here then we're effectively detached from upstream unless we keep remembering to make those changes every time we pull...

Also not sure what the right fix would actually be. Sure they've put multiple grammar scope names in a name but there isn't an Atom-compatible syntax for that so we'd just have to choose one or come up with some kind of combo name.

Open to suggestions or PRs (should probably sync upstream again before anyone bothers with that)

from language-typescript.

lierdakil avatar lierdakil commented on July 17, 2024

I was more thinking along the lines of patching first-mate to handle scopes with spaces actually.

A technically "correct" fix on the grammar side would be a scope-within-a-scope. So essentially (and forgive me if it doesn't work, it was a while since I last touched grammar)

match: '...'
name: 'meta.definition.function.ts'
captures: 0: name: 'entity.name.function.ts'

... although it isn't nestable, or at least I can't say from the top of my head how it could be.

from language-typescript.

lierdakil avatar lierdakil commented on July 17, 2024

And by "nestable" I actually meant "can handle more than two scopes". Sorry, long day.

from language-typescript.

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.