brackets-archive / bracketsIssues

Archive of issues in brackets.
0 stars 0 forks source link

[CLOSED] support typescript #1766

Open core-ai-bot opened 3 years ago

core-ai-bot commented 3 years ago

Issue by ghost Thursday Oct 11, 2012 at 08:53 GMT Originally opened as https://github.com/adobe/brackets/issues/1812


with the nodejs typescript runtime.

anyone else into this idea ?

core-ai-bot commented 3 years ago

Comment by GarthDB Thursday Oct 11, 2012 at 13:52 GMT


It's an awesome idea. We just need a mode for code mirror.

Sent from my iPhone

On Oct 11, 2012, at 1:53 AM, Gerard Webb notifications@github.com wrote:

with the nodejs typescript runtime.

anyone else into this idea ?

— Reply to this email directly or view it on GitHub.

core-ai-bot commented 3 years ago

Comment by ghost Thursday Oct 11, 2012 at 14:00 GMT


glad i am not the only one.

WHat i liked about typescript was the refactoring support through the strong typing aspects of the language. just adding syntax highlighting to code mirror woudl be a waste. The refactoring is where the action is in my opinion. I nevr want to have to go back to Visual Studio every again

On 11 October 2012 15:52, Garth Braithwaite notifications@github.comwrote:

It's an awesome idea. We just need a mode for code mirror.

Sent from my iPhone

On Oct 11, 2012, at 1:53 AM, Gerard Webb notifications@github.com wrote:

with the nodejs typescript runtime.

anyone else into this idea ?

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/adobe/brackets/issues/1812#issuecomment-9340536.

core-ai-bot commented 3 years ago

Comment by peterflynn Friday Oct 12, 2012 at 00:52 GMT


There are a number of pieces that would need to happen to truly support any new language in Brackets:

And then there are additional features that could take advantage of the strong typing that TypeScript offers (same goes for other languages like Dart):

As you can see, that's quite a bit of work. @gedw99, are there any of these you'd be interested in working on? :-)

Ideally new languages could be added optional extensions, keeping the core Brackets distro lightweight. Many of the things above can already be written that way, but there are a few (e.g. new syntax coloring modes) that would need new core APIs first. Feel free to contribute to those areas too, as it will move things closer to making this possible!

core-ai-bot commented 3 years ago

Comment by ghost Sunday Oct 14, 2012 at 07:48 GMT


I can't help. Am doing too much at the moment.

The refactoring currently works OK in the web site that Microsoft put up for demo the language. Looking at how it works should show how to work out the API you need.

G On 12/10/2012 2:53 AM, "Peter Flynn" notifications@github.com wrote:

There are a number of pieces that would need to happen to truly support any\ new language in Brackets:

  • Syntax coloring mode
  • Comment/uncomment command
  • Extend 'Quick Open' to support jumping to functions within a file (as is supported in JS)
  • Extend 'Quick Edit' to support opening functions in other files (as in JS)

And then there are additional features that could take advantage of the strong typing that TypeScript offers (same goes for other languages like Dart):

  • Code hinting driven by static type info
  • Search/replace (i.e. refactoring) driven by static type/reference info
  • Related features like 'go to definition'
  • More advanced features like 'call hierarchy', etc.

As you can see, that's quite a bit of work.@gedw99https://github.com/gedw99, are there any of these you'd be interested in working on? :-)

Ideally new languages could be added optional extensions, keeping the core Brackets distro lightweight. Many of the things above can already be written that way, but there are a few (e.g. new syntax coloring modeshttps://trello.com/card/api-for-extensions-to-add-new-syntax-coloring-modes/4f90a6d98f77505d7940ce88/639) that would need new core APIs first. Feel free to contribute to those areas too, as it will move things closer to making this possible!

— Reply to this email directly or view it on GitHubhttps://github.com/adobe/brackets/issues/1812#issuecomment-9363545.

core-ai-bot commented 3 years ago

Comment by pthiess Monday Oct 15, 2012 at 17:53 GMT


Rviewed

core-ai-bot commented 3 years ago

Comment by rolo2012 Thursday Nov 01, 2012 at 17:37 GMT


@peterflynn I think that can use a language parser like jison to help implement other languages support, put jison in the thirdparty folder of brackets and make a utils ex: ParserUtil.js module. Is a good idea?

I planing use jison to make a extension for php code-hints and syntax error detection.

core-ai-bot commented 3 years ago

Comment by jviereck Sunday Dec 16, 2012 at 01:10 GMT


The TypeScript source comes already with all things required for a good IDE integration. I've created a small example on how to access it:

http://jviereck.github.com/TypeScriptServiceExample/

This is all running in the browser. It makes use of the functionality exposed by the TypeScript LanguageService. The ILanguageService has the following API:

    // Taken from TypeScriptRepo/src/services/languageService.ts

    export interface ILanguageService {
        host: ILanguageServiceHost;

        refresh(): void;

        logAST(fileName: string): void;
        logSyntaxAST(fileName: string): void;

        getErrors(maxCount: number): TypeScript.ErrorEntry[];

        getScriptAST(fileName: string): TypeScript.Script;
        getScriptErrors(fileName: string, maxCount: number): TypeScript.ErrorEntry[];
        getCompletionsAtPosition(fileName: string, pos: number, isMemberCompletion: bool): CompletionInfo;
        getTypeAtPosition(fileName: string, pos: number): TypeInfo;
        getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): SpanInfo;
        getBreakpointStatementAtPosition(fileName: string, pos: number): SpanInfo;
        getSignatureAtPosition(fileName: string, pos: number): SignatureInfo;
        getDefinitionAtPosition(fileName: string, pos: number): DefinitionInfo;
        getReferencesAtPosition(fileName: string, pos: number): ReferenceEntry[];
        getOccurrencesAtPosition(fileName: string, pos: number): ReferenceEntry[];
        getImplementorsAtPosition(fileName: string, pos: number): ReferenceEntry[];
        getNavigateToItems(searchValue: string): NavigateToItem[];
        getScriptLexicalStructure(fileName: string): NavigateToItem[];
        getOutliningRegions(fileName: string): NavigateToItem[];

        getScriptSyntaxAST(fileName: string): ScriptSyntaxAST;
        getFormattingEditsForRange(fileName: string, minChar: number, limChar: number, options: FormatCodeOptions): TextEdit[];
        getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextEdit[];
        getBraceMatchingAtPosition(fileName: string, position: number): TextRange[];
        getSmartIndentAtLineNumber(fileName: string, lineNumber: number, options: Services.EditorOptions): number;

        getAstPathToPosition(script: TypeScript.AST, pos: number, options: TypeScript.GetAstPathOptions /*= Tools.GetAstPathOptions.Default*/): TypeScript.AstPath;
        getIdentifierPathToPosition(script: TypeScript.AST, pos: number): TypeScript.AstPath;
        getSymbolAtPosition(script: TypeScript.AST, pos: number): TypeScript.Symbol;

        getSymbolTree(): Services.ISymbolTree;
    }

I'm not an expert on this, but feel free to ask if something is unclear on how to use it. I would love to see TS support in Brackets :)

core-ai-bot commented 3 years ago

Comment by pthiess Sunday Jan 06, 2013 at 00:23 GMT


Thanks for your feedback -:). I added a Trello Card - #749.@gedw99@jviereck@rolo2012 Please vote on the card.

THX, The Brackets Team

core-ai-bot commented 3 years ago

Comment by tomsdev Friday Feb 15, 2013 at 20:27 GMT


Hi, maybe you could add to the trello card the extension that adds support for TypeScript: https://github.com/tomsdev/brackets-typescript-code-intel

core-ai-bot commented 3 years ago

Comment by pthiess Friday Feb 15, 2013 at 20:32 GMT


Hi@tomsdev - thanks a ton for the suggestion. Done

core-ai-bot commented 3 years ago

Comment by SeanHub Monday Oct 05, 2015 at 08:30 GMT


Is native support going to be added? Seems the Trello card (https://trello.com/c/vLGtd5L1/749-support-typescript) hasn't been touched since 2013.

core-ai-bot commented 3 years ago

Comment by abose Tuesday Oct 06, 2015 at 07:39 GMT


on a sidenote: Better ES6 support is coming in 1.6.

core-ai-bot commented 3 years ago

Comment by zaggino Monday Aug 01, 2016 at 04:40 GMT


@SeanHub try out https://github.com/zaggino/brackets-typescript extension