Skip to content

Commit

Permalink
📝 clarify formatCodeOptions
Browse files Browse the repository at this point in the history
closes #196
  • Loading branch information
basarat committed Mar 20, 2015
1 parent afd50bf commit 1380a83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tsconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Note: `files` is kept up to date by expansion of `filesGlob`.
}
```
### formatCodeOptions
We pass these to the TypeScript language service as code formatting options.
These are used when you request the IDE to format TypeScript code.

```json
{
Expand Down

13 comments on commit 1380a83

@erikvullings
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your example tsconfig, you use !node_modules/**/*.d.ts in the filesGlob section. On Windows, this didn't work for me, and I had to use !./node_modules/**/*.d.ts including the leading ./. You might consider updating the example.

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikvullings thanks ❤️ we discovered that and updated the default glob we generate already : https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/tsconfig/tsconfig.ts#L137 Thanks for pointing us to fix the docs (done : b92d2db) 🌹 Have a lovely weekend.

@erikvullings
Copy link

@erikvullings erikvullings commented on 1380a83 Mar 22, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in VS and sublime, when I press CTRL-tab, it moves the cursor to the last visited file instead of the next tab. This allows me to switch quickly between my most recent files.

There is a package for that : https://atom.io/packages/tab-switcher I need to test it though

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have both projects open in one atom editor, as I currently have two versions open, each with their own tsconfig

Yes it should just work. You can have as many projects as you want open. The active context is determined by the editor your cursor is in ❤️

@erikvullings
Copy link

@erikvullings erikvullings commented on 1380a83 Mar 23, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an option to quickly jump back to where I came from?

I use alt+- from : https://atom.io/packages/last-cursor-position

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of Atom, it seems to create the result.js several
times (at least, my gulp task that monitors the file is called many times).
Do you have a clue why this happens?

Perhaps its triggering change during buffering. Or its annoyed by us building the directory. The code is fairly clear without chance of loops : https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/lang/modules/building.ts#L40-L43 You can put a console.error in there to see its called only once ❤️

  1. When I press CTRL-S in a TypeScript project, the project compiles to
    one output file, but the generated code has an issue with a class that
    extends another.

Are you using --out. Can we get a reproducible sample? I personally do not use --out anymore as it doesn't scale.

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With --out we would need to support _reference.ts.

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I've noticed that there is no Intellisense support for internal
variables in a forEach, e.g. in below example, although r1 and r2's type
are well-defined (and shown in the tooltip), there is no Intellisense
support for r1.

I tried it. It works:

image

my source:

interface ILookupResult {
    name: string;
    score: number;
}

function mergeResults(result1: ILookupResult[], result2: ILookupResult[]):
    ILookupResult[] {
    var r: ILookupResult[] = [];
    result1.forEach((r1) => {
        result2.forEach((r2) => {
            r1.
        });
    });
    r = r.sort((a, b) => { return b.score - a.score; });
    return r;
}

@erikvullings
Copy link

@erikvullings erikvullings commented on 1380a83 Mar 25, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikvullings
Copy link

@erikvullings erikvullings commented on 1380a83 Mar 25, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@basarat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erikvullings lets move the out discussion here : #206

Please sign in to comment.