Commit Graph

2331 Commits

Author SHA1 Message Date
Alex Blewitt
7159f6af1d Enable sourcekitd to be built by default on Linux
The Linux build has a dependency on the libdispatch library,
which is needed by the various native libraries for sourcekitd.

On macOS, the dependency for libdispatch is satisfied directly through
the base OS, but on Linux no such dependency exists.

Modify this so that if the SourceKit library is built, and the
libdispatch library is already present, then we shell out to make
the libdispatch binary project when the SourceKit is built.

Issue: SR-1676
2016-12-01 10:54:36 +00:00
Alex Blewitt
8531c5d190 Fix build errors for SourceKit on Linux (#5862)
The sourcekitd-repl, sourcekitd-test and complete-test use symbols
from both the coverage and lto modules, specifically
`llvm::coverage::CoverageFilenamesSectionWriter::write` and
`llvm::lto::thinBackend`. Adding these to the list of dependencies
allows SourceKit to be built on Linux.

Issue: SR-3223
2016-11-30 10:14:07 -08:00
Slava Pestov
7b59e75d34 IDE: hasType() => hasInterfaceType() 2016-11-29 03:05:31 -07:00
Rintaro Ishizaki
264be984b5 [AST] Eliminate NamedTypeRepr
Now that, TupleTypeRepr holds all information needed.
2016-11-26 14:17:57 +09:00
Jiang Jiang
8fc75457c3 [SourceKit] Fix a warning in SwiftSourceDocInfo.cpp
tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp:1042:13: warning: unused variable 'CompIns' [-Wunused-variable]
      auto &CompIns = AstUnit->getCompilerInstance();
            ^
1 warning generated.

Introduced by 5e8d8da380.
2016-11-24 18:29:18 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Slava Pestov
0c95a3bd1d AST: Correctly set PrintAST::CurrentType
When printing a nested type, make sure we call getMemberSubstitutions()
with the correct DeclContext.
2016-11-19 22:53:53 -08:00
Slava Pestov
2e901cb4f9 AST: Clean up PrintOptions a bit 2016-11-19 22:53:53 -08:00
Bob Wilson
f10ae47b9f Merge remote-tracking branch 'origin/master' into master-next 2016-11-15 17:32:28 -08:00
Xi Ge
5e8d8da380 [Test] Add range-info test driver to swift-ide-test. NFC 2016-11-15 13:48:15 -08:00
swift-ci
beaf946d27 Merge pull request #5645 from Aghassi/sourcekit-docs-complete.open 2016-11-13 22:24:39 -08:00
David Aghassi
da6111117e Fixed wording around codecomplete def 2016-11-11 09:37:50 -05:00
Doug Gregor
84d70a2284 Eliminate witness markers. NFC 2016-11-09 19:22:51 -08:00
Ben Langmuir
c8f53ff8c4 [index] Disable typo-correction when indexing
The errors won't be captured in the response, and it can be expensive to
do typo-correction when there are many errors, which is common in
indexing.

rdar://problem/28963058
2016-11-09 10:53:26 -08:00
David Aghassi
a2ffcfbbda Swapped wrong definitions and corrected minor mistakes
-  key.codecomplete.options, not key.options
-  Moved codecomplete definition to codecomplete.open
and vice versa
2016-11-08 20:31:26 -05:00
David Aghassi
29bf6a5ed0 Reformatted documentation based on benlangmuir recs 2016-11-08 08:24:18 -05:00
Xi Ge
5838e03726 [SourceKit] Add a SourceKitd test argument -pos-end.
Manually specifying range length is laborious and error-prone; this
commit adds an argument -end-pos=Line:Column to specify the end
position of a given range under test.
2016-11-07 18:08:18 -08:00
Xi Ge
d6f8f142a7 [SourceKit] Teach range-info request to recognize single declaration and multi-statements. (#5672) 2016-11-07 16:54:48 -08:00
David Aghassi
a1d77ee3f8 [SourceKit] Added completion.open-result docs 2016-11-04 21:50:26 -04:00
David Aghassi
4eced39f4b [SourceKit] Adds documentation for complete.open 2016-11-04 21:06:33 -04:00
Xi Ge
ac3411234d [SourceKit] The initial implementation of range-info request.
Like cursor-info, range info (""source.request.cursorinfo"") answers some
questions clients have for a code snippet under selection, for instance, the type of a selected
expression. This commit implements this new quest kind and provides two
simple information about the selected code: (1) the kind of the
snippet, currently limited to single-statement and expression; and (2)
the type of the selected expression. Gradually, we will enrich the
response to provide more insight into the selected code snippet.
2016-11-03 16:07:04 -07:00
practicalswift
cc852042c9 [gardening] Fix accidental trailing whitespace. 2016-10-29 10:22:58 +02:00
Bob Wilson
564fc6f22d Clean up my changes for llvm r284966.
Sorry -- I meant to include this with the previous commit. LLVM is
moving away from llvm::sys:TimeValue in favor of std::chrono. For consistency
with LLVM, I used the new llvm::sys::TimePoint type in most places.
There are a few places, like the SourceKit files modified here, where it
makes more sense to use std::chrono directly.
2016-10-28 13:17:26 -07:00
Bob Wilson
5c4f517824 Checkpoint fixes for llvm r284966 (TimeValue) 2016-10-28 12:09:57 -07:00
Bob Wilson
b227f45b7e Merge remote-tracking branch 'origin/master' into master-next 2016-10-27 22:28:28 -07:00
swift-ci
7a3a1e3697 Merge pull request #5500 from nkcsgexi/closure 2016-10-27 13:43:11 -07:00
Xi Ge
9577d980b0 [SourceKit] Initialize pointer as nullptr to fix a crash. rdar://28959889 2016-10-27 13:01:50 -07:00
Saleem Abdulrasool
228c4d5102 SourceKit: adapt for SVN r284681
LLVM SVN r284681 replaced `LLVM_FUNCTION_NAME` with `__func__` as all supported
compilers support that keyword now.  The holdout was MSVC, and swift requires
clang, so this is always supported.  NFC.
2016-10-26 15:27:52 -07:00
Ben Langmuir
d0581eaef3 Merge pull request #5479 from benlangmuir/compact-doc-struct
[sourcekit] Introduce a lazy representation for DocumentStructure responses
2016-10-26 12:58:39 -07:00
Ben Langmuir
178641d527 [sourcekit] Introduce a lazy representation for DocumentStructure responses
Previously, document structure responses were created using XPC
dictionaries, but this forced deserialization of the large nested
dictionaries no matter what the access pattern was.  The new format uses
our custom buffer machinery, and only deserializes dictionaries that are
actually needed.

The performance improvement is around 25% for an editor.open, and 35-40%
for an editor.replacetext request in the large files I've tested. The
performance improvements are in serialization (inside the service),
deserialization (client), and disposal of the response object (client).

rdar://problem/28789756
2016-10-26 10:16:58 -07:00
Xi Ge
7bd01b5ad1 [SourceKit] Never try to report mangled names for archetypes without contexts. rdar://28094209 2016-10-24 16:56:32 -07:00
Xi Ge
e01f0ac8b9 [SourceKit][DocInfo] For enum element decls, inherit their parent enum decls' deprecated attributes, if there are any. rdar:// 28802301 2016-10-21 12:49:59 -07:00
Doug Coleman
e03265877c [cmake] Make sure SOURCEKIT_DEPLOYMENT_OS is only set once, at the top.
Reset Darwin specific CMake variables to match the correct
SDK and architecture. This is needed when cross compiling, or we'll end up with
conflicting SDK and architectures.

Remove unused variable SOURCEKIT_GLOBAL_DEPLOYMENT_TARGET_FLAGS.
2016-10-18 13:40:04 -07:00
Xi Ge
0443a4dc46 [SourceKit] for cursor-info request, printing underlying types instead of namelias type. rdar://28216890 (#5339) 2016-10-17 22:18:59 -07:00
Bob Wilson
3fd92f82e8 Use StringRef in more places to match recent llvm changes.
llvm r283043 and possibly other recent changes switch to use StringRef
instead of char* pointers. Update Swift to match. In some cases, this is
a clear improvement. It would be good to assess the impact on memory use,
particularly for the Filename component of source locations.

Note that the change to SILLocation::isNull fixes an apparent bug where
the location was treated as null when the filename was *not* null.
2016-10-15 11:02:07 -07:00
Slava Pestov
cfe9e6a3de IDE: Use GenericSignatures and interface types (mostly)
There was a ton of complicated logic here to work around
two problems:

- Same-type constraints were not represented properly in
  RequirementReprs, requiring us to store them in strong form
  and parse them out when printing type interfaces.

- The TypeBase::getAllGenericArgs() method did not do the
  right thing for members of protocols and protocol extensions,
  and so instead of simple calls to Type::subst(), we had
  an elaborate 'ArchetypeTransformer' abstraction repeated
  in two places.

Rewrite this code to use GenericSignatures and
GenericFunctionType instead of old-school GenericParamLists
and PolymorphicFunctionType.

This changes the code completion and AST printer output
slightly. A few of the changes are actually fixes for cases
where the old code didn't handle substitutions properly.
A few others are subjective, for example a generic parameter
list of the form <T : Proto> now prints as <T where T : Proto>.

We can add heuristics to make the output whatever we want
here; the important thing is that now we're using modern
abstractions.
2016-10-02 23:49:15 -04:00
Michael Gottesman
e338c45964 [lto][cmake] When building with lto on macOS, specify to the linker the path where it should put the generated LTO object file.
This is important so that the object file references in the debug info are
preserved for possible use by dsymutil.

rdar://28062659
2016-09-24 22:38:33 -07:00
practicalswift
8d6251de66 [gardening] Fix accidental uses of \t 2016-09-17 13:15:26 +02:00
practicalswift
3a4ee89034 [gardening] Use consistent formatting. 2016-09-17 12:12:49 +02:00
practicalswift
7c63623ffc [gardening] Fix 13 recently introduced typos. 2016-09-16 20:30:57 +02:00
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00
Ben Langmuir
5ef19576a7 Merge pull request #4313 from rintaro/cc-attribute-colon
[Code Completion] Suffix ": " instead of "=" when completing attribute argument names
2016-08-16 13:38:38 -07:00
Rintaro Ishizaki
81c1edee5d [CodeCompletion] Suffix ": " instead of "=" when completing attribute argument names
In addtion, renamed DeclAttrParamEqual to DeclAttrParamColon.
2016-08-17 02:33:04 +09:00
Michael Gottesman
b3819c6783 [cmake] Rename COMPONENT_DEPENDS to LLVM_COMPONENT_DEPENDS (#4311)
Now that I am going to be adding an IN_SWIFT_COMPONENT argument, I need to do
this to distinguish the concepts of an LLVM_COMPONENT and a SWIFT_COMPONENT.
2016-08-16 12:13:34 -04:00
Dmitri Gribenko
f6035ff7e4 Merge pull request #3862 from RLovelett/bugfix/typo-in-sourcekitd-test
[SourceKit] Fix typo in sourcekitd-test error handler response
2016-08-04 13:06:28 -07:00
John McCall
afdda3d107 Implement SE-0117.
One minor revision: this lifts the proposed restriction against
overriding a non-open method with an open one.  On reflection,
that was inconsistent with the existing rule permitting non-public
methods to be overridden with public ones.  The restriction on
subclassing a non-open class with an open class remains, and is
in fact consistent with the existing access rule.
2016-08-02 07:46:38 -07:00
Ryan Lovelett
1384a394ed [SourceKit] Fix typo in sourcekitd-test error handler response
Currently if you type in a malformed `pos` argument it responds with:

    wrong pos format, it should be '<line>:<column'

After the change it responds with:

    wrong pos format, it should be '<line>:<column>'
2016-07-29 11:50:00 -04:00
Ryan Lovelett
54bb4084b2 [SourceKit] Add a table of contents and format tweak
- Make the Demangle header match the other headers in the doc (e.g.,
  double hash)
- Add a table of contents that is sorted alphabetically by request key
  with a link to the header in the document
2016-07-27 21:37:40 -04:00
Ryan Lovelett
9432de218f [SourceKit] Document source.request.cursorinfo 2016-07-27 21:03:16 -04:00
Ryan Lovelett
e6a1a8c541 [SourceKit] Document source.request.protocol_version 2016-07-27 21:02:40 -04:00