57 Commits

Author SHA1 Message Date
steveluc
ae4f164eb2 Added gc of configured projects to handle case in which file is opened
in directory configured by tsconfig.json, but file not part of the
configured project.
2015-03-20 22:14:39 -07:00
steveluc
8798235c68 Added support in the server for tsconfig.json. When a host opens a
file F, the server will check whether F is configured by a
tsconfig.json file.  If so, the project specified by the tsconfig.json
file becomes the LS context for F.
2015-03-20 21:56:20 -07:00
steveluc
34e612c9fc Add handling of hard tabs in server buffers. Change message protocol to
pass locations as line/offset pairs instead of line/column pairs, where
offset is a 1-based character offset from the beginning of the line.
Offset will be equal to column if the line contains no tabs.  If the
line contains tabs, offset will be less than or equal to column,
depending on how many tabs are before the offset.  Also added tab size
and indent size to file open message.
2015-03-17 22:58:12 -07:00
steveluc
e1d7389f3e Merge remote-tracking branch 'origin/master' into
serverConfigurationMessage.
2015-03-17 17:51:16 -07:00
steveluc
2c60cf96dd Add use of host-configured format options to additional code site. 2015-03-16 15:10:58 -07:00
steveluc
51c64b385c Added configuration message. Added logic to expand tabs to spaces using
host-configured tab size.
2015-03-16 14:47:46 -07:00
steveluc
37c6f69f01 Hold at most 4 snapshots per file in the server. This is about 1K per file. 2015-03-09 11:57:50 -07:00
steveluc
04320e415e Renames and comments as requested by feedback. 2015-03-09 01:23:03 -07:00
steveluc
360e47880e Addressed comments on code style and organization. 2015-03-07 23:19:58 -08:00
steveluc
9a45160ab6 Changed TypeScript server logging to use an environment variable TSS_LOG
as follows.  If TSS_LOG is not set, no logging will occur.  If TSS_LOG
is set to any value, logging will occur as before this change (log file
will be in directory of tsserver.js with name .logPID where PID is the
process id of the server process; log will contain the pre-change
messages).  If TSS_LOG is set to a string that has the form "-file
fileName", the log file will be in the tsserver.js directory with name
'fileName'.  If TSS_LOG is set to a string that has the form "-level
levelName", then the level of logging will be set to 'levelName'.
Currently the two levels are 'normal' and 'verbose'.  The TSS_LOG string
can contain zero, one or both of its options as in "-file LOG -level
verbose".  At the verbose level, the server will log every request,
response and event, and will also give elapsed time for message processing.
2015-03-07 17:13:52 -08:00
steveluc
8bef6d7ebc Added additional cases for format on enter. These cases fix bugs in the
orginal format on enter (which wasn't distinguishing whether there was
existing whitespace to start some types of lines).
2015-03-07 15:44:21 -08:00
steveluc
fedc809c3b Added guards for end of file edits. 2015-03-03 17:04:05 -08:00
steveluc
f9fd365215 Added logic to handle requests for changes past the end of the buffer. 2015-03-02 16:31:51 -08:00
Steve Lucco
42bc64b168 Merge pull request #2125 from Microsoft/updateProjectStructure
Update project structure on idle after change
2015-02-25 21:58:46 -08:00
steveluc
68049ea503 Added comments for updateProjectStructure. 2015-02-24 00:08:34 -08:00
steveluc
fa504f6808 Update project structure after change. After each change a
timer is started.  If timer finishes before another change takes place,
project structure will be updated to reflect any changes in reference
comments or import statements.
2015-02-23 23:44:15 -08:00
CyrusNajmabadi
5141f1d4c9 Merge pull request #2111 from Microsoft/navToPatternMatcher
Move NavigateTo over to using the new pattern matcher.
2015-02-23 16:01:23 -08:00
steveluc
b0c522d0d0 Add missed file from addNavtoLimit branch. 2015-02-23 12:06:07 -08:00
steveluc
47d265b20b Changed no content action for completions from exception to error message. 2015-02-22 23:33:35 -08:00
steveluc
f9518b252b Added update of project structure on idle following change (if no
changes in last s seconds (where s is currently 1.5), then check project
structure to account for references that may have changed.  Turned this
off pending fix for getScriptFileNames returning only the root names.
Added event handler for deleted file, so that session can update error
messages upon deletion of a file from a project.
2015-02-22 23:27:45 -08:00
Cyrus Najmabadi
fd1b5875e2 Move NavigateTo over to using the new pattern matcher. 2015-02-22 21:25:43 -08:00
steveluc
f19619e22b Add maxResultCount optional field to NavtoRequestArgs. Change
session.ts to use this field.  Remove sort of nav items from getNavigateToItems in
sesion.ts because LS now does the sort.  Removed no content throw in
quick info as this happens frequently with Sublime (every cursor move
calls quick info, and quick info is only available on symbols).  Added
mechanism for other commands to avoid throwing and instead return a
specific error message, so that we don't make the log unreadable (as it
was with hundreds of quick info stack traces).
2015-02-22 00:44:14 -08:00
Cyrus Najmabadi
eb5936b06f Merge branch 'master' into baseZero
Conflicts:
	src/harness/harnessLanguageService.ts
2015-02-20 16:56:58 -08:00
steveluc
d364f6110e Style fixes. 2015-02-19 12:56:53 -08:00
steveluc
4b590836e7 Split completions req/response pair into two messages "completions" and
"completionEntryDetails".   This mirrors the function of the LS API and
increases performance of completion in large projects.
2015-02-18 15:12:35 -08:00
steveluc
3868fb5a6b Removed deleteLen from change request; added endLine, endCol that mark
the end of the deleted Range (inclusive).  DeleteLen was not always
accurate because editors normalize \r\n to \n in some cases, affecting
the length of ranges.  In Diagnostic response items, changed len field
to end to address the same range length issue.  Flattened
MessageDiagnosticChains in diagnostic message text, since clients expect
string there.  Renamed ts.server.protocol to simply protocol in
session.ts and client.ts since module name prefix is clear.

Based on protocol feedback: Changed LineCol to Location.  Changed
CodeLocation interface name prefix to FileLocation.  Changed DiagEvent
to DiagnosticEvent.  Removed anonymous types.
2015-02-18 00:14:52 -08:00
steveluc
cadd57c10f Change rename response to return the rename info + nested location
information: one array of location information per file.  Add interface
definition for rename response body.
2015-02-17 02:02:59 -08:00
steveluc
d2712dd793 Removed file mapping compression technique due to brittleness of
approach.  As necessary, will substitute grouping or paging approaches.
2015-02-16 23:43:05 -08:00
Mohamed Hegazy
54e6756831 Remove unused code and only expose needed types/classes 2015-02-15 20:04:14 -08:00
Mohamed Hegazy
bbcdb61254 remove unused cancellationToken class 2015-02-15 19:55:10 -08:00
Mohamed Hegazy
bdd0bf341b Comment formatting 2015-02-15 19:48:35 -08:00
Mohamed Hegazy
8a9ac8d338 Change ServerProtocol module to ts.server.protocol 2015-02-15 19:14:33 -08:00
Mohamed Hegazy
ca34838535 Remove unused code 2015-02-15 19:13:52 -08:00
Mohamed Hegazy
f5c1bfbca7 renmae protodef.d.ts to protocol.d.ts and protocol.ts to session.ts 2015-02-15 18:49:22 -08:00
Mohamed Hegazy
d9d2e99495 Remove debugging statemetns 2015-02-15 18:43:39 -08:00
Mohamed Hegazy
76c7fdf6d1 Add test for completionEntryDetails 2015-02-15 18:24:30 -08:00
Mohamed Hegazy
8944df18d4 use EncodedFile everywhere in responses 2015-02-15 17:37:26 -08:00
Mohamed Hegazy
50ca35a979 Make method names inline with matching LS function names 2015-02-15 16:28:39 -08:00
Mohamed Hegazy
2a02655f72 Add navbar test 2015-02-15 16:23:36 -08:00
Mohamed Hegazy
40d3cb78d5 Add test for rename 2015-02-14 23:07:20 -08:00
Mohamed Hegazy
178e8f76e6 Add test for quickInfo 2015-02-14 22:28:38 -08:00
Mohamed Hegazy
11e246036b Add test for find references 2015-02-14 21:49:10 -08:00
Mohamed Hegazy
d396ddfa7b Add test for completions 2015-02-14 19:53:23 -08:00
Mohamed Hegazy
89267bcd6f Move fileWatching logic to the server to allow for testing on non-node systems 2015-02-14 19:53:12 -08:00
Mohamed Hegazy
ce828d0cae Get details for member completions as well as completions matching prefix 2015-02-14 17:21:49 -08:00
Mohamed Hegazy
b1750453ad use ts.getDefaultLibFileName to get the default library file name 2015-02-14 17:21:17 -08:00
Mohamed Hegazy
dfd8a0620d Always default to using JSON and do not format it 2015-02-14 15:50:06 -08:00
Mohamed Hegazy
a0b557e1e2 Recover from git corruption 2015-02-14 15:43:38 -08:00
Mohamed Hegazy
99373dbd89 Add test for goto def 2015-02-12 16:31:08 -08:00
Mohamed Hegazy
c0b1254072 Support brace matching 2015-02-12 13:35:11 -08:00