Commit Graph
1082 Commits
Author SHA1 Message Date
Vladimir Matveev 7f749909da Merge pull request #1746 from Microsoft/formattingTemplateLiterals
fixed smart indentation\formatting in template literals
2015-01-20 17:54:47 -08:00
Anders Hejlsberg bb33167f7e Merge pull request #1692 from Microsoft/tsconfig
Support for tsconfig.json files
2015-01-20 17:08:26 -08:00
Anders Hejlsberg 45e700e515 Adding src/compiler/tsconfig.json and src/services/tsconfig.json 2015-01-20 16:28:57 -08:00
Vladimir Matveev 8497667f33 drop trailing trivia prior to rescanning it 2015-01-20 14:44:24 -08:00
Vladimir Matveev a6d374ee21 fixed smart indentation\formatting in template literals 2015-01-20 14:07:01 -08:00
Mohamed Hegazy 8d5b65a533 Merge pull request #1654 from csnover/fix-1653
Use system line ending in services compiler host
2015-01-19 15:54:27 -08:00
Colin Snover d736014f35 Expose optional getNewLine for language service hosts
Fixes #1653.
2015-01-19 05:02:36 +00:00
Vladimir Matveev 2ce6c5635d do not apply format on enter for the first line 2015-01-13 19:11:21 -08:00
Vladimir Matveev 150720bd70 when formatting lists check if end list token still belongs to the parent node 2015-01-13 14:22:53 -08:00
Dick van den Brink e4701a6600 Remove unused timer.ts file 2015-01-12 23:34:21 +01:00
Lorant Pinter 47b8deb382 Show --noImplicitAny as an option to throw errors, not warnings
Fixes #1632
2015-01-11 11:14:06 +01:00
Cyrus Najmabadi 12cb284e5d CR feedback. 2014-12-29 16:23:11 -08:00
Cyrus Najmabadi a1d04c3c65 Merge branch 'master' into mergeMarkers1 2014-12-28 18:58:47 -08:00
Cyrus Najmabadi 52e15e7bee Enable incremental parsing by default. 2014-12-26 22:21:53 -08:00
Cyrus Najmabadi ff9f59c913 Remove unused constants. 2014-12-18 19:43:36 -08:00
Cyrus Najmabadi a6ea497ff1 Classify the '=' sign in variable/parameter/property as if it was an operator. 2014-12-18 19:38:19 -08:00
Cyrus Najmabadi 48bef4698b Provide better error recovery when we encounter merge markers in the source.
Previously we would just treat each merge marker as trivia and then continue
scanning and parsing like normal.  This worked well in some scenarios, but
fell down in others like:

```
class C {
    public foo() {
<<<<<<< HEAD
        this.bar();
    }
=======
        this.baz();
    }
>>>>>>> Branch

    public bar() { }
}
```

The problem stems from the previous approach trying to incorporate both branches of the merge into
the final tree.  In a case like this, that approach breaks down entirely.  The the parser ends up
seeing the close curly in both included sections, and it considers the class finished.  Then, it
starts erroring when it encounters "public bar()".

The fix is to only incorporate one of these sections into the tree.  Specifically, we only include
the first section.  The second sectoin is treated like trivia and does not affect the parse at all.
To make the experience more pleasant we do *lexically* classify the second section.  That way it
does not appear as just plain black text in the editor.  Instead, it will have appropriate lexicla
classifications for keywords, literals, comments, operators, punctuation, etc.  However, any syntactic
or semantic feature will not work in the second block due to this being trivia as far as any feature
is concerned.

This experience is still much better than what we had originally (where merge markers would absolutely)
destroy the parse tree.  And it is better than what we checked in last week, which could easily create
a borked tree for many types of merges.

Now, almost all merges should still leave the tree in good shape.  All LS features will work in the
first section, and lexical classification will work in the second.
2014-12-18 19:18:13 -08:00
Cyrus Najmabadi ef2087add5 Merge branch 'master' into layering 2014-12-18 12:20:32 -08:00
Cyrus Najmabadi b155351e0a Remove unnecessary capture of the diagnostics type checker. 2014-12-17 17:06:12 -08:00
Cyrus Najmabadi b37b98138d Merge branch 'master' into layering
Conflicts:
	src/compiler/checker.ts
	src/compiler/utilities.ts
2014-12-17 15:35:30 -08:00
Daniel Rosenwasser 90a32ad2b0 Fixed messed-up formatting from moving around code. 2014-12-17 15:11:26 -08:00
Daniel Rosenwasser 017486b119 Made 'location' non-optional in 'getSymbolKind'. 2014-12-17 15:11:22 -08:00
Daniel Rosenwasser b37221142c Moved helpers to bottom of 'getDefinitionAtPosition'. 2014-12-17 15:11:18 -08:00
Cyrus Najmabadi 4545549e07 Disable incremental by default before merging into master. 2014-12-17 12:41:08 -08:00
Cyrus Najmabadi f459951431 Merge branch 'diagnostics' into sourceFileUpdate
Conflicts:
	src/compiler/parser.ts
2014-12-16 23:48:00 -08:00
Cyrus Najmabadi 2748a5b163 Remove 'grammarDiagnostics' from SourceFile. 2014-12-16 23:00:14 -08:00
Cyrus Najmabadi 7f893f9b9a Rename method to be clearer. 2014-12-16 18:50:34 -08:00
Cyrus Najmabadi 9df59c39ee Change TextChangeRange to be a record type as well. 2014-12-16 18:40:15 -08:00
Cyrus Najmabadi 7f3a73b7c8 Change 'TextSpan' to be a simple record type with free floating functions. 2014-12-16 18:31:06 -08:00
Cyrus Najmabadi b73128c50f CR feedback. 2014-12-16 16:17:48 -08:00
Cyrus Najmabadi 5a2fb94a95 Clean things up so the services layer can easily emit without having to contort compiler hosts. 2014-12-16 14:42:58 -08:00
Cyrus Najmabadi 96c3c90d9a Rename typechecker parameter related to whether or not we produce diagnostics.
Comment what the flag means.
2014-12-16 13:30:34 -08:00
Cyrus Najmabadi 4aa361d4bf Layer the compiler so that every layer only depends on hte layers below it.
The layering is now:

types
core
scanner
parser
binder
checker
emitter
program
2014-12-16 13:14:14 -08:00
Cyrus Najmabadi 8917e96663 Merge branch 'funcDeclsInBlocks' into sourceFileUpdate
Conflicts:
	src/compiler/parser.ts
	src/compiler/utilities.ts
2014-12-16 03:12:31 -08:00
Cyrus Najmabadi 592ad476a8 Reduce unnecessary arrow function allocations. 2014-12-16 02:53:58 -08:00
Cyrus Najmabadi c7bb0a5ae6 Don't store variable statement flags on its variable declaration children. 2014-12-16 02:50:38 -08:00
Cyrus Najmabadi bd76ebd02b Enable incremental parsing by default.
Provide flag to disable incremental parsing if necessary.
2014-12-14 12:39:11 -08:00
Cyrus Najmabadi ffdddd53af Merge branch 'master' into funcDeclsInBlocks
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
2014-12-12 14:05:09 -08:00
Cyrus Najmabadi 2f833d5f97 Provide a way for tests to try out incremental parsing. 2014-12-12 02:21:45 -08:00
Cyrus Najmabadi f218ce7684 Merge branch 'master' into sourceFileUpdate
Conflicts:
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/parser.ts
	tests/baselines/reference/APISample_node_compile.js
	tests/baselines/reference/APISample_node_compile.types
	tests/baselines/reference/APISample_standalone_compile.js
	tests/baselines/reference/APISample_standalone_compile.types
2014-12-12 00:52:07 -08:00
Cyrus Najmabadi 0391e02fee Merge branch 'master' into sourceFileUpdate
Conflicts:
	src/compiler/parser.ts
	src/services/formatting/tokenSpan.ts
	src/services/text.ts
2014-12-11 18:08:57 -08:00
CyrusNajmabadi 122d8a4d98 Merge pull request #1456 from Microsoft/mergeMarkers
Make the compiler resilient to encountering merge conflict markers in a source code file.
2014-12-11 18:04:25 -08:00
Mohamed Hegazy 1049b7139d Respond to code review comments 2014-12-11 17:08:11 -08:00
Mohamed Hegazy de73d50ee9 Remove compiletionSettings handeling from shims 2014-12-11 17:08:05 -08:00
Cyrus Najmabadi 7df3a407c2 Make the compiler resilient to encountering merge conflict markers in a source code file. 2014-12-11 16:56:10 -08:00
Cyrus Najmabadi fbeb7dd75e Merge branch 'funcDeclsInBlocks' into sourceFileUpdate
Conflicts:
	src/services/outliningElementsCollector.ts
2014-12-11 15:16:46 -08:00
Cyrus Najmabadi 63dbb78d02 Merge branch 'master' into sourceFileUpdate 2014-12-11 15:07:49 -08:00
Cyrus Najmabadi 76df92cc78 Merge branch 'master' into funcDeclsInBlocks 2014-12-11 14:59:03 -08:00
Cyrus Najmabadi b692ea9b66 Remove TryBlock and FinallyBlock.
They break the rule that syntactically identical constructs use the same syntax kind.  This
prevents node reuse in incremental parsing.
2014-12-11 14:40:25 -08:00
Daniel Rosenwasser 0ce3861602 Moved non-exposed functions to utilities; fix up emitted .d.ts in Jakefile.
Conflicts:
	src/compiler/parser.ts
2014-12-11 14:00:36 -08:00