Commit Graph

689 Commits

Author SHA1 Message Date
Xi Ge
f669afff50 [SourceKit] When reporting the cursor info for parameter decls, report the locations of the function-like entities they belong to. rdar://30702790 (#8541) 2017-04-04 15:24:36 -07:00
swift-ci
a460cbbd28 Merge pull request #8516 from nkcsgexi/asan-scope 2017-04-03 16:26:22 -07:00
Xi Ge
6f6d4fc50e SourceKit: Fix a stack-use-after-scope issue found by ASAN. rdar://31117311 2017-04-03 15:10:33 -07:00
Xi Ge
9e76187829 SourceKit: Simplify some unnecessary vector size initializations. NFC (#8502) 2017-04-03 13:51:37 -07:00
Norio Nomura
83451eb063 Produce libsourcekitdInProc.so instead of sourcekitdInProc.framework if not Darwin 2017-04-02 09:16:45 +09:00
Xi Ge
08c2aabc24 [cmake] swiftIDE should depend on swiftIndex. 2017-03-30 15:40:38 -07:00
Xi Ge
1827fb1436 RangeInfo: Report RValue type if a decl reference is of read-only LValue type. (#8300) 2017-03-23 15:52:54 -07:00
practicalswift
479fa0f49c [gardening] Use isa<T> instead of dyn_cast<T> if the result is not needed 2017-03-21 12:39:36 +01:00
Erik Eckstein
0f87b5efb2 Remove the useNewMangling function
NFC
2017-03-17 16:10:36 -07:00
swift-ci
0d9e27794c Merge pull request #8103 from hughbe/sourcekit-blocks-cleanup 2017-03-14 19:40:49 -07:00
Hugh Bellamy
d378d353a5 Remove unecessary public and nonull annotations from internal SourceKit APIs 2017-03-15 08:57:15 +07:00
Xi Ge
0d97dd4992 [SourceKit] Add a new request to translate markup text to its XML equivalence. rdar://30587403 (#8088)
Required fields:
- "key.request": "source.request.convert.markup.xml"
- "key.sourcetext": "markup text"

Expected response:
- "key.sourcetext": "xml text"
2017-03-14 15:13:43 -07:00
Hugh Bellamy
89330bdaa8 Fix sourcekit attributes when compiling with clang-cl 2017-03-14 15:47:17 +07:00
Hugh Bellamy
391d8d1b35 Fix SourceKit files to work with a compiler that doesn't support blocks 2017-03-14 09:24:38 +07:00
Slava Pestov
162b2d252e AST: Include gardening to minimize dependencies on Expr.h
A lot of files transitively include Expr.h, because it was
included from SILInstruction.h, SILLocation.h and SILDeclRef.h.

However in reality most of these files don't do anything
with Exprs, especially not anything in IRGen or the SILOptimizer.

Now we're down to 171 files in the frontend which depend on
Expr.h, which is still a lot but much better than before.
2017-03-12 22:26:56 -07:00
Xi Ge
b4cf37bf7d Sema: several improvements on missing switch cases diagnostics. (#8026)
1. Make sure the actions taken by fixits are reflected in diagnostics messages.
2. Issue missing cases diagnostics at the start of the switch statement instead of its end.
3. Use <#code#> instead of <#Code#> in the stub.
2017-03-10 19:32:37 -08:00
Alex Hoppen
dd1c661c16 Merge pull request #8015 from ahoppen/isOperator-gardening
[Gardening] Change calls of getName().isOperator() to isOperator()
2017-03-10 21:10:33 +00:00
Alex Hoppen
1b7055db5a [Gardening] Change calls of getName().isOperator() to isOperator() 2017-03-10 09:06:20 +00:00
Erik Eckstein
5e80555c9b demangler: put the demangler into a separate library
Previously it was part of swiftBasic.

The demangler library does not depend on llvm (except some header-only utilities like StringRef). Putting it into its own library makes sure that no llvm stuff will be linked into clients which use the demangler library.

This change also contains other refactoring, like moving demangler code into different files. This makes it easier to remove the old demangler from the runtime library when we switch to the new symbol mangling.

Also in this commit: remove some unused API functions from the demangler Context.

fixes rdar://problem/30503344
2017-03-09 13:42:43 -08:00
Xi Ge
b5256f53b2 Sema: introduce a language option flag, DiagnosticsEditorMode. (#7982)
SourceKit always sets it positively. This may lead to more aggressive fixits however
less informative messages. We currently use the flag only for filling protocol stubs.
2017-03-08 12:46:02 -08:00
practicalswift
a7b34c0b25 [gardening] Remove unused variable prevCase 2017-03-07 16:26:34 +01:00
Nathan Hawes
2684564590 [indexer] report defs/refs of parameters without a separate external name 2017-02-28 11:55:34 -08:00
practicalswift
99ceb78c7d Merge pull request #7723 from practicalswift/gardening-20170223
[gardening] Shell fixes. Consistent headers. a-vs-an typos. Python fixes. Unused variables and methods.
2017-02-27 14:05:05 +01:00
Erik Eckstein
7d7dc5aaac Demangler: Use a bump-pointer allocator for node allocation.
This makes the demangler about 10 times faster.
It also changes the lifetimes of nodes. Previously nodes were reference-counted.
Now the returned demangle  node-tree is owned by the Demangler class and it’s lifetime ends with the lifetime of the Demangler.

Therefore the old (and already deprecated) global functions demangleSymbolAsNode and demangleTypeAsNode are no longer available.

Another change is that the demangling for reflection now only supports the new mangling (which should be no problem because
we are generating only new mangled names for reflection).
2017-02-24 19:04:13 -08:00
Erik Eckstein
437d4da38d Demangling: Remove StringRef-versions of demangling functions from demangle_wrappers because they are now available in Demangle itself.
This is just refactoring. NFC.
2017-02-24 15:19:18 -08:00
practicalswift
3367d05ee2 [gardening] Remove unused variable OverUSROffs 2017-02-24 09:38:00 +01:00
Hugh Bellamy
f66bbfb7cf Merge pull request #7613 from hughbe/msvc-static-assertion-failure
Fix MSVC static assertion failure in SourceKit
2017-02-22 08:15:22 +07:00
Xi Ge
c62ec0c116 SourceKit: Introduce a new enum class to describe the kind of resolved sema token kind. NFC (#7657) 2017-02-20 23:18:54 -08:00
Hugh Bellamy
2cdee2f09d Fix MSVC static assertion failure in SourceKit 2017-02-21 10:33:25 +07:00
swift-ci
64882e0bbf Merge pull request #7611 from hughbe/resolve-symlinks 2017-02-19 20:37:18 -08:00
Hugh Bellamy
3464a9399d Port SwiftLangSupport::resolvePathSymlinks to Windows 2017-02-20 10:04:46 +07:00
swift-ci
2b8f47e3df Merge pull request #7610 from hughbe/sourcekit-api-msvc 2017-02-19 00:16:06 -08:00
Hugh Bellamy
dd0f185118 Fix some MSVC ambiguity errors in SourceKitAPI 2017-02-19 14:25:00 +07:00
Hugh Bellamy
2bc2341300 Fix SourceKit unreachable warnings 2017-02-19 14:20:52 +07:00
Hugh Bellamy
487955c306 Merge pull request #7607 from hughbe/atomic-msvc-ambi
Fix MSVC conversion from std::atomic<T *> to bool error
2017-02-19 13:14:21 +07:00
Hugh Bellamy
52501a2f9b Fix MSVC conversion from std::atomic<T *> to bool error
> swift\tools\SourceKit\include\SourceKit/Support/ThreadSafeRefCntPtr.h(139): error C2440: 'return': cannot convert from 'const std::atomic<T *>' to 'bool'
>          with
>          [
>              T=SourceKit::ImmutableTextUpdate
>          ] (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
>  swift\tools\SourceKit\include\SourceKit/Support/ThreadSafeRefCntPtr.h(139): note: Ambiguous user-defined-conversion (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
>  swift\tools\SourceKit\include\SourceKit/Support/ThreadSafeRefCntPtr.h(139): note: while compiling class template member function 'SourceKit::ThreadSafeRefCntPtr<SourceKit::ImmutableTextUpdate>::operator bool(void) const' (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
>  swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp(242): note: see reference to function template instantiation 'SourceKit::ThreadSafeRefCntPtr<SourceKit::ImmutableTextUpdate>::operator bool(void) const' being compiled
>  swift\tools\SourceKit\include\SourceKit/Support/ImmutableTextBuffer.h(66): note: see reference to class template instantiation 'SourceKit::ThreadSafeRefCntPtr<SourceKit::ImmutableTextUpdate>' being compiled (compiling source file swift\tools\SourceKit\lib\Support\ImmutableTextBuffer.cpp)
2017-02-19 09:55:09 +07:00
Hugh Bellamy
ddb97c113a Fix MSVC "ambiguous symbol errors" in SourceKit 2017-02-19 09:53:03 +07:00
Xi Ge
03a17e1f06 Cleanup: Move Swift to ObjC name translation API to libAST to allow larger audience body. NFC (#7586) 2017-02-17 22:09:25 -08:00
David Farler
677e03df85 [SourceKit] Vend the localization key found in documentation comments
If a documentation comment has a - LocalizationKey: field, strip it
out of the documentation body and report it in cursor/doc info with
the key "key.localization_key".

rdar://problem/30383329
2017-02-17 17:54:15 -08:00
David Farler
3645736ac0 Merge pull request #7393 from bitjammer/syntax-tree
Start the Syntax structured editing library
2017-02-17 15:26:00 -08:00
David Farler
7ee42994c8 Start the Syntax library and optional full token lexing
Add an option to the lexer to go back and get a list of "full"
tokens, which include their leading and trailing trivia, which
we can index into from SourceLocs in the current AST.

This starts the Syntax sublibrary, which will support structured
editing APIs. Some skeleton support and basic implementations are
in place for types and generics in the grammar. Yes, it's slightly
redundant with what we have right now. lib/AST conflates syntax
and semantics in the same place(s); this is a first step in changing
that to separate the two concepts for clarity and also to get closer
to incremental parsing and type-checking. The goal is to eventually
extract all of the syntactic information from lib/AST and change that
to be more of a semantic/symbolic model.

Stub out a Semantics manager. This ought to eventually be used as a hub
for encapsulating lazily computed semantic information for syntax nodes.
For the time being, it can serve as a temporary place for mapping from
Syntax nodes to semantically full lib/AST nodes.

This is still in a molten state - don't get too close, wear appropriate
proximity suits, etc.
2017-02-17 12:57:04 -08:00
Hugh Bellamy
fa3543d3c5 Fix some pylint errors for double whitespace after class/function 2017-02-17 15:37:19 +07:00
Xi Ge
b1c5c995a1 [IDE][Utils] Add an IDE stream utility. (#7546)
This provides a stream utility for writing to a underlying string buffer multiple string pieces and retrieve them later as StringRef when the underlying buffer is stable.
2017-02-16 17:29:42 -08:00
practicalswift
4e9bb3c9b2 Add a py3 compatible workaround for the removed long type 2017-02-15 21:43:52 +01:00
Argyrios Kyrtzidis
c309fb2620 Merge pull request #7477 from akyrtzi/fsystem-search-path-option2
Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
2017-02-15 12:04:36 -08:00
Argyrios Kyrtzidis
32e5112874 For the -Fsystem option, address feedback by Jordan. 2017-02-14 23:35:06 -08:00
Xi Ge
143c5a5d82 Address @jrose-apple's code review comments (#7474) 2017-02-14 18:41:21 -08:00
Argyrios Kyrtzidis
ca906d1e99 Add '-Fsystem' framework search option to indicate path for frameworks that should be treated as 'system'
This has the effect of propagating the search path to the clang importer as '-iframework'.
It doesn't affect whether a swift module is treated as system or not, this can be done as follow-up enhancement.
2017-02-14 16:13:25 -08:00
Xi Ge
055da1fbfb [SourceKit] Teach name translation request to translate Swift names to ObjC ones (by using PrintAsObjC). (#7449) 2017-02-14 14:25:52 -08:00
Hugh Bellamy
cb3bdcc2a3 Merge pull request #7408 from hughbe/llvm-fallthrough
Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH
2017-02-13 17:39:59 +07:00