Commit Graph

1494 Commits

Author SHA1 Message Date
Nathan Hawes
534ec7ed87 Merge pull request #8569 from nathawes/rdar30248264-cursorinfo-invalid-base-type
[cursor-info] Fix crash due to invalid base type in the PrintOptions passed to the AST printer
2017-04-06 17:11:33 -07:00
Nathan Hawes
53e1bdc1e3 [cursor-info] Fix crash due to invalid base type in the PrintOptions passed to the AST printer
Resolves rdar://problem/30248264
Also added test cases for rdar://problem/30292429 (already fixed)
2017-04-06 16:04:07 -07:00
Xi Ge
1fcbc90f5f [SourceKit] Use offset to indicate the locations of parameters' parents to facilitate subsequent cursor-info requests. 2017-04-04 17:32:30 -07:00
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
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
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
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
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
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
Hugh Bellamy
2bc2341300 Fix SourceKit unreachable warnings 2017-02-19 14:20:52 +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
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
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
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Xi Ge
b32424953e [SourceKit] Add a new request to translate from Objc names to Swift names and vice versa.
Extensive cross-language tooling support needs to bridge decl names between two different languages more freely. This SourceKit request is designed to translate Objc names to Swift names and vice versa. Working similarly to cursor-info requisition, the name translation request requires a Swift reference to a Swift/Clang decl, and the preferred name to translate from, and language kind that the given name belongs to. If the translation succeeds, SourceKit service responds with the corresponding name than belongs to the other kind of language.

Newly introduced keys:

“key.namekind": “source.lang.name.kind.objc” | "source.lang.name.kind.swift"
“key.basename”: “name"
“key.argnames”: [“name"]
“key.selectorpieces”: [“name[:]"]

This commit only implements translation from Objc to Swift.
2017-02-10 17:50:12 -08:00
Chris Bieneman
44b6f32f0e Clean up handling of CMark library dependency.
This change depends on:

https://github.com/apple/swift-cmark/pull/4
2017-02-08 14:32:50 -08:00
Graydon Hoare
7137bab0c7 [Bridging PCH] Teach SourceKit to ignore the bridging-pch driver options. 2017-02-02 17:07:10 -08:00
Xi Ge
6b699d8855 SourceEntityWalker: keep track of type reference in extension declarations' openings. (#7192)
This is necessary when we want to differentiate between type reference
on extension declaration's start, e.g "extension A {}", and other
references of "A". NFC on existing functionality.
2017-02-01 17:09:01 -08:00
Slava Pestov
b3cabb0745 Use llvm casts in various places instead of looking at {Expr,Decl,TypeBase}::getKind()
Also add some FIXMEs for some code in debug info emission that
looks incorrect.
2017-01-30 00:08:53 -08:00
Bob Wilson
24a61b5b5d Merge branch 'master-next'
This merge contains the changes to accompany the switch to the new stable
branches of llvm, clang, and compiler-rt that are based on swift-4.0-branch.
2017-01-18 09:22:52 -08:00
Argyrios Kyrtzidis
da1328f04b [sourcekit] Fix assertion hit when doing cursor-info on a subscript parameter declaration.
Fixes rdar:/30060622
2017-01-17 14:56:36 -08:00
Bob Wilson
c765d5e3a5 Merge remote-tracking branch 'origin/master' into master-next 2017-01-12 15:58:19 -08:00
Argyrios Kyrtzidis
7076ebbf72 [index] Switch to using the general accessor getter/setter symbol kinds. 2017-01-11 17:09:17 -08:00
Argyrios Kyrtzidis
db8ec19f55 [index] Use the index symbol types and APIs from the clang header.
This avoids duplication and centralizes handling of symbols.
2017-01-10 14:49:07 -08:00
Bob Wilson
cf3a0458f2 Merge remote-tracking branch 'origin/master' into master-next 2017-01-10 09:05:23 -08:00
Nathan Hawes
563bc04da1 Merge pull request #6677 from nathawes/swift-indexing
Add roles and relations for Swift indexing
2017-01-09 14:48:35 -08:00
Nathan Hawes
32ba5f24cb [indexer] Don't output implicit symbol names in order to maintain the existing swift index responses 2017-01-09 13:48:47 -08:00