Git Product home page Git Product logo

typescript-tmlanguage's People

Contributors

abu-co avatar andrewbranch avatar anubmat avatar armanio123 avatar billti avatar danielrosenwasser avatar dependabot[bot] avatar gheoan avatar infininight avatar kingwl avatar kufii avatar mhegazy avatar microsoft-github-policy-service[bot] avatar mjbvz avatar mtpc avatar orta avatar pchaigno avatar pranavsenthilnathan avatar rbuckton avatar samb avatar sandersn avatar sheetalkamat avatar stkb avatar tcztzy avatar typescript-bot avatar uniqueiniquity avatar weswigham avatar zhengbli avatar zuckjet avatar zzzen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

typescript-tmlanguage's Issues

Arrow functions: Signature not tokenized the same way as for functions

Tokenize this:

            return this.travelWorld((cell: Cell) => {
                cell.live = Math.random() < this.initialLifeProbability;
                return cell;
            });

Note that cell: Cell is a single token (scope block body decl declaration meta method object ts).
It would be great if it can follow the tokenization for functions

Syntax Highlighting

class A {

}

interface Inter {

}

class Cl extends A implements Inter {
}

'A' and 'Inter' have same color as that of the keyword in the line 'class Cl extends A implements Inter'

Generic Types

Syntax highlighting on generic type keyword appears to be falling down.

image

Without generic:

image

Highlight ES6 object method shorthand syntax

ES6 has a shorthand syntax for defining methods on objects similar to that of a class.

The method declaration in

let x = {
    hello() {
        let hello = "world";
    }
};

should have the same highlighting as

class X {
    hello() {
        let hello = "world";
    }
}

In the current TypeScript Sublime Text plugin, the method name in the first code sample is not highlighted:
screen shot 2016-01-05 at 2 44 43 pm

(as a side note, GitHub has the same highlighting issue at present; do they use this repository?)

TypeScript wrong highlighting when using `if` within `for`

From @igabesz on November 26, 2015 11:26

TypeScript highlighter interprets if calls within a for loop as function definitions if the if has middle parameter and brackets. The interpretation starts failing in the for loop for the last parameter.

Not the consequence of installed extensions.
Highlighting fails for other color themes as well, not only Monokai.

// OK
for (var i=0;; i++) {
    if (i===0) {}
}
// Partially wrong, see for loop 3rd parameter
for (let i=0; i<5; i++)
    if (i===0) {}
// Wrong
for (var i=0; i<5; i++) {
    if (i===0) {}
}
// Wrong
for (let i=0; i<5; i++) {
    if (i===0) {}
}
// Wrong
for (; i<5;) {
    if (i===0) {}
}

vs-highlight-error

Copied from original issue: microsoft/vscode#704

editor don't detect object and there methods (javascript)

Hello,

I try to modified Material Theme and I can't set specific colors on objects and there attributs or methods
this is because there are not detected separately (see picture)

vsc-editor

for exemple, I want to have something like that

window and setTimeout are in different colors and console and log too

vsc-target

Organize dependencies

We need to transition the Sublime repo into depending on this repository. In theory, this is as simple as adding a submodule or subtree (though it sounds like what we want is just a subtree).

One problem is that the Sublime repository currently depends on this repository's top-level files existing in its own top level. Two solutions are:

  1. Using soft links that reference files within this submodule.
  2. Introducing a post-clone step that copies files over from this submodule.

I personally am leaning towards option 1.

An open question is whether or not the testing plugin should be merged into this repository. I am leaning towards us doing so. There is no reason our testing infrastructure needs to be private and separate from this repo. Merging the two will reduce friction for contributors and encourage users to write tests.

operator symbols and keywords all get 'keyword.operator' scope

Try the following example in VS code (0.10.6) in the dark theme:

module Body {
    export class Cell {
        public parent: Cell;

        constructor(parent: Cell) {
            this.parent = parent;
            if (typeof parent === 'object' || parent instanceof Error) {
            }
        }

image

Note that instanceof and typeof are rendered white instead of blue as other keywords.

The TS grammar uses 'keyword.operator' for operator symbols like '=', '+', '!=', but also for JS keywords as switch, instanceof, import, delete, export, import, from, in, new, void, as, of.

We want to colorize the keywords, but not the symbols.

My suggestion is to use 'keyword.operator' only for symbols

  • use 'keyword' for 'instanceof', 'typeof', 'is', 'as', 'in', 'of', 'delete', 'new',
  • for 'import' I'd suggest to use 'keyword.control.import.include'
  • for 'export' and 'void', I'd suggest 'storage.type'
  • for 'switch' use 'keyword.control'

Add Decorator syntax

Ported from microsoft/TypeScript-Sublime-Plugin#377

Hi,

I want to use decorators, but they mess up the syntax coloring.
Could support for decorators be added? Even if it is only to avoid messing up the rest of the code?

Currently, the decorators look odd, but when a parameter decorator is combined with a pair: method(@AdapterParam() {req, res}: AdapterData), the syntax is lost.

image

I wish I could send a pull request, but I can't seem to understand how the tmLanguage system works.
A patch for me locally would also be awesome (in case you don't want support for experimental features).

Thanks a lot!

Muli-line strings in JavaScript not colored, code following multi-line string not colored

From @KevinSCreative on December 30, 2015 18:13

After the first line, multi-line strings in JavaScript don't get string color. In the following example, only "Hello World" has the string color, and the obj variable declaration is all one color. In the default theme, 'var' is supposed to be blue. I would also expect the rest of the string to be orange in the default theme, not just the first line.

I am running VSC 0.10.6 and I have no extensions installed.

var test = 'Hello World!\
<div>\
<p>Testing</p>\
</div>\
    ';
var obj = $(test);

Copied from original issue: microsoft/vscode#1716

Async methods highlight

Async highlight is not working for decorated methods (Atom, atom-typescript 8.1)

    @Action('/promise')
    public async asyncResponse(): Promise<Object> {
        return {
            promiseResult: 'promise is ok'
        }
    }

also, class keyword now looks like type in this example:

export class IndexController extends AppController {
...

original issue: TypeStrong/atom-typescript#819

s

image

  • the counter label doesn't seem to be vertically centered
  • the red box seems strange. Maybe it should have the same height as the find box, or maybe instead of a box just red label instead (i.e. in Edge: 'No matches')

Test code is broken (and 3 cases actually failing)

Currently the test code is checking none of the test cases except the last one, through a classic closure mistake in tests/test.ts:

describe("Compare generated with baselines", () => {
    for (var file of fs.readdirSync('generated')) {
        var generatedText = fs.readFileSync('generated/' + file, 'utf8');
        var baselinesText = fs.readFileSync('baselines/' + file, 'utf8');
        describe('Comparing ' + file, () => {
            it('should be the same', () => {
                chai.expect(compareText(generatedText, baselinesText)).to.true;
            })
        })
    }
})

Only the last generated values of generatedText and baselinesText will be checked against other each time. In actual fact these tests are failing:

  • FunctionMethodOverloads
  • Issue156
  • Issue335

It's is easy enough to fix (the test code, not the failing tests) and I'm happy to submit a PR too but I wanted to add some other issues I came across while trying to make and test some changes to the syntax files:

  • The tests won't run without first manually downloading the *.d.ts files with tsd install. This should be automated (probably as part of npm install), or documented.
  • The /tests/typings folder should be added to .gitignore
  • Again with the typings/dependencies, assertion-error.d.ts doesn't seem to be used and the chai module is barely used. Not if there were other things planned for these.

'implements' not correctly tokenized

Try the following example in VS code (0.10.6) in the dark theme:

module Conway {
    export interface Foo {
    }
    export class Bar {
    } 
    export class Cell extends Bar implements Foo {
    }
}

image

Note that implements is colored like the type. It gets the same scope as the type name
(block declaration heritage meta object parent storage type ts)

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.