clausreinke / typescript-tools

(repo no longer active) Tools related to the TypeScript language
Apache License 2.0
266 stars 29 forks source link

References command #17

Closed Railk closed 11 years ago

Railk commented 11 years ago

I'm looking into references command to implement some basic refactoring :

When i do a references command on the main.ts file on the start method, i have those in main.ts and second.ts.

But when i do that on the actual method declaration in second.ts first time i have only the second.ts one and on the second call this time i have the main.ts, i didn't have first.

Bash@ /c/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references $ tss main.ts
"loaded c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/main.ts, TSS listening.."

> references 7 10 c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/second.ts

[
    {
        "ref":{
            "fileName":"c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/second.ts",
            "minChar":55,
            "limChar":60,
            "isWriteAccess":true
        },
        "file":"c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/second.ts",
        "min":{"line":7,"character":9},
        "lim":{"line":7,"character":14}
    }
]

> references 7 10 c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/second.ts

[
    {
        "ref":{
            "fileName":"c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/second.ts",
            "minChar":55,
            "limChar":60,
            "isWriteAccess":true
        },
        "file":"c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/second.ts",
        "min":{"line":7,"character":9},
        "lim":{"line":7,"character":14}
    },
    {
        "ref":{
            "fileName":"c:/ProgramFiles/SublimeText3/Data/Packages/T3S/__work__/tests/references/main.ts",
            "minChar":77,
            "limChar":82,
            "isWriteAccess":false
        },
        "file":"c:/Program Files/SublimeText3/Data/Packages/T3S/__work__/tests/references/main.ts",
        "min":{"line":4,"character":8},
        "lim":{"line":4,"character":13}
    }
]

main.ts

import Second = require("second");

var second = new Second.Test()
second.start();
second.stop();

second.ts

export class Test{

    constructor(){

    }

    public start(){
        return this;
    }

    public stop(){
        return this;
    }
}

I don't know what's causing that.

draivin commented 11 years ago

Somewhat related question, every time you introduce a new import you have to reload TSS?

clausreinke commented 11 years ago

Looks like an upstream issue: https://typescript.codeplex.com/workitem/1688

@Draivin we do have a project mailing list - please use that for questions, instead of highjacking issues:-) but, yes: import dependency chasing is done on initial load and on reload.

clausreinke commented 11 years ago

@Railk ps, tss now resolves file names, so you don't have to type full paths in interactive test sessions anymore.

Railk commented 11 years ago

Great for the interactive test sessions, it will be easier ^^. And thanks for the follow up i'll look at both codeplex and here.

clausreinke commented 11 years ago

fixed upstream in develop, which I've just updated to.

Railk commented 11 years ago

Great ! thank you i'll try the update.