- upgrade dependencies
- fix crashes in non-workspace usages
CVE-2021-28792: Fixes vulnerability which allowed malicous workspaces to execute code when opened by providing. Now the vulnerable configs cannot be overrided in workspaces anymore:
sourcekit-lsp.serverPath
, swift.languageServerPath
, swift.path.sourcekite
, swift.path.sourcekiteDockerMode
, swift.path.swift_driver_bin
, swift.path.shell
. Reported by @Ry0taK.
- Better and more helpful error messages on first start
- Upgraded dependencies
- Running default target did not work #94
- Allow lang server restart #82 #85 by @clayreimann
- Commands for stop, clean and run #82 #85 by @clayreimann
- Added tables for all configurations and commands to README
- Did not respect default toolchain path
- Default to Xcode's sourcekit-lsp on macOS instead of sourcekite
- README.md instruction improvements #70 by @fxn.
- Support iOS for sourcekit-lsp #64 by @haifengkao
sourcekit-lsp
with different toolchains failed #63- Drop broken debugger of SDE #22
If you are curious about how to set debugging up, see Debugging Swift in VS Code.
- Fixed ignored Toolchain Path vknabel/sourcekite#9
- Fixed an issue preventing autocompletion to work reliably on Linux, fixes #54
- Installation instructions now correctly link
/usr/lib/libsourcekitdInProc.so
, noticed by @kennethz3 - Support quoted arguments in settings, fixed by @haifengkao
- Now LSP-mode
sourcekite
supportssourcekit-lsp.toolchainPath
after updating to [email protected]
sourcekit-lsp.serverPath
wasn't read correctly, fixed by M1xA @AnyCPU
- Latest sourcekite is now compatible with Swift 5.
- Added options for sourcekit-lsp:
sourcekit-lsp.serverPath
andsourcekit-lsp.toolchainPath
. #39 sde.languageServerMode
now explicitly offerssourcekit-lsp
.- Updated installation instructions with a stronger emphasize on sourcekit-lsp.
More details at SDE 2.7.0 released
- Add support for alternative language servers like RLovelett/langserver-swift #21
Probably Apple's recently announced language server will be supported, too. See https://forums.swift.org/t/new-lsp-language-service-supporting-swift-and-c-family-languages-for-any-editor-and-platform/17024 for more infos.
If you prefer RLovelett's LangserverSwift, SDE will read your old swift.languageServerPath
-config. In order to actually use it your need to set sde.languageServerMode
to langserver
.
- Warnings indicated a build failure
- Resolve
~
to the home dir #30 - Removed unuseful data from hover docs
- Remove code formatter, use vknabel/vscode-swiftformat instead
- Installation instructions had wrong argument order for
ln -s
(thanks to @mijo-gracanin) - Added note about installing
libcurl4-openssl-dev
(thanks to @mijo-gracanin)
- Autocompletion for SPM dependencies #27 (thanks to @yeswolf)
- Better support for vscode workspaces
- New setting
swift.targets
for supporting autocompletion if SDE can't.
Especially when using Xcode projects SDE cannot infer the correct compiler arguments. Now you can fix this by explicitly supplying targets with their sources and compiler arguments. SDE will still detect other targets automatically.
{
"swift.targets": [
{
"name": "YourWatchExtension",
"path": "YourProject/YourWatchExtension",
"sources": ["**/*.swift"],
"compilerArguments": [
"-sdk",
"/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk",
"-target",
"armv7k-apple-watchos4.0"
]
}
]
}
- Hotfix release: outdated vscode dependencies #31 (thanks to @akdor1154)
- Hotfix release: fixes autocompletion
Broken release
- Dummy module did always precede real ones leading to bad completion behavior
- Extension did not work correctly
- Can now be disabled by
"sde.enable": false
- Bumped internal dependencies to be more reliable on newer vscode versions
- New setting
sde.swiftBuildingParams
allows run other commands thanswift build
#24 jinmingjian/sde#32
It is now possible to run different commands when building swift code.
"sde.swiftBuildingParams": ["build"]
: default setting"sde.swiftBuildingParams": ["build", "--build-path", ".vscode-build"]
: build in different directory, see #24"sde.swiftBuildingParams": ["build", "--build-tests"]
: compile tests, but do not run them"sde.swiftBuildingParams": ["test"]
: runs unit tests jinmingjian/sde#32
- Code format did fail #19
- Code format always indented by 4 spaces. Now configurable.
By default editor.tabSize
will be used. As this setting is global and affects all code, you can optionally override it using "[swift]": { "tabSize": 2 }
.
- Accidentially logged SourceKit's
key.kind
andkey.description
- Removed unused config
editor.quickSuggestions
- Will no longer write
sde.buildOnSave
oreditor.quickSuggestions
to workspace settings #
will now trigger completions-target
will now be detected forUIKit
,AppKit
,WatchKit
andFoundation
on macOS and linux #15- Index all swift files together when no
Package.swift
defined #14
- Fixes autocompletion for methods and invocations leading to invalid syntax #9
- Fixes a bug thats lead the extension to stop working #10
- Display documentation on Hover #11
- Autocompletion for external libraries like AppKit and UIKit after restart #8
- Display short documentation on autocompletion
- More reliable autocompletion, especially for global namespace
- New
"sde.sourcekit.compilerOptions"
setting
Just add "sde.sourcekit.compilerOptions": ["-target", "arm64-apple-ios11.0"]
to your workspace settings in Visual Studio Code and restart it.
- Improved new README
- Deprecated debugger, use LLDB Debugger instead
An example config of using LLDB Debugger can be seen below. program
should contain the path to your built executable as before, the preLaunchTask
is optional, but will run swift build
before each debug session to keep your binaries up to date.
Note: Currently I don't know of any reliable solution to debug your Swift tests. If you do, please file an issue or write me an email.
// .vscode.json/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Run your Executable",
"program": "${workspaceFolder}/.build/debug/your-executable",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "swift-build"
}
}
// .vscode.json/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "swift-build",
"type": "shell",
"command": "swift build"
}
}
- Did not work with latest vscode #2 and #3
- Initial Swift 4 support jinmingjian/sde#38.
- make a sourcekite docker image and add a new experimental setting "swift.path.sourcekiteDockerMode" for easier adoption for Linux users (issue: #26) (MacOS users do not need to update to this version in that there is no other additions in this version)
- release 2.0 ships a Swift language server backend and a new simple, async, pipe driven language server frontend (issue: #9). This new backend solves the unicode problem of original tool sourcekit-repl. This new frontend improves the code logic and the performance which leave the room for future messaging optimization when needed as well. Futhermore, it is not needed to build whole things from Swift's sources any more.
The 2.0
release introduces a new tool, SourceKite, as the interface to SourceKit library. Since the Swift ABI
is not stable, you need to build it if you want to use SDE. Go to SourceKite for further instructions.
Also because the Swift ABI is not stable, you may find that the Hover Help or the Code Completion don't display the right information after you upgrade your Swift toolchain. This is because the SourceKit library you linked with the SourceKite tool can't understand the sources or binaries of your project. To fix this, rebuild your project and restart vscode.
If the release broke your current experience or if you accidentally upgraded, you can go back to the previous releases like this:
- Download the 1.x vsix from the release page
- Remove the installed version in your vscode
- Install the local
.vsix
package in your vscode
- serveral fixs for release 1.x and we want to release great new 2.0
- experimental built-in sourcekit interface (only for macOS)
- add an config option for shell exec path (issue: #15)
- fix hard-coded shell exec path for macOS (issue: #14)
- add container type info in hover (issue: #6)
- Initial public release.
You can read a hands-on introduction for a detailed explanation.