Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from vknabel/refactoring-and-debug-target-impr…
Browse files Browse the repository at this point in the history
…ovements

Refactoring and debug target improvements
  • Loading branch information
vknabel authored Sep 10, 2018
2 parents 99cb30e + 260e8ce commit 6c619fd
Show file tree
Hide file tree
Showing 17 changed files with 1,368 additions and 979 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
27 changes: 19 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib"
}
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"typescript.tsdk": "./node_modules/typescript/lib",
"swift.targets": [
{
"name": "Watch",
"path": "projects/Watch",
"sources": ["Watch/*.swift"],
"compilerArguments": [
"-sdk",
"/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk"
]
}
]
}
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
# Changelog

## 2.5.0

- Autocompletion for SPM dependencies #27 (thanks to [@yeswolf](https://github.com/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.

```json
{
"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"
]
}
]
}
```

## 2.4.4

- Hotfix release: outdated vscode dependencies #31 (thanks to @akdor1154)
- Hotfix release: outdated vscode dependencies #31 (thanks to [@akdor1154](https://github.com/akdor1154))

## 2.4.3

Expand Down
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,38 @@ There aren't too much documents about the development of this project. If you ha

### How do I get autocompletion for UIKit?

Just add `"sde.sourcekit.compilerOptions": ["-target", "arm64-apple-ios11.0"]` to your workspace settings in Visual Studio Code and restart it.
You can add new autocomplation targets through your configuration.

```json
{
"swift.targets": [
// iOS
{
"name": "YourApp",
"path": "YourApp/YourApp",
"sources": ["**/*.swift"],
"compilerArguments": [
"-sdk",
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk",
"-target",
"arm64-apple-ios11.0"
]
},
// WatchOS
{
"name": "YourApp",
"path": "YourApp/YourWatchExtension",
"sources": ["**/*.swift"],
"compilerArguments": [
"-sdk",
"/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk",
"-target",
"armv7k-apple-watchos4.0"
]
}
]
}
```

### Other questions?

Expand Down
45 changes: 43 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": "https://github.com/vknabel"
},
"license": "Apache-2.0",
"version": "2.4.4",
"version": "2.5.0",
"publisher": "vknabel",
"icon": "icons/icon.png",
"galleryBanner": {
Expand Down Expand Up @@ -78,12 +78,51 @@
},
"sde.sourcekit.compilerOptions": {
"type": "array",
"description": "Optional compiler options like the target or search paths.",
"description": "Optional compiler options like the target or search paths. Will only be used as default. `(debug|release).yaml` builds will override these settings.",
"default": [],
"items": {
"type": "string"
}
},
"swift.targets": {
"type": "array",
"description": "If SDE cannot reliably detect all targets, you can manually configure them.",
"default": [],
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true,
"description": "The module name of the target. Will be passed as -module-name."
},
"path": {
"type": "string",
"required": true,
"description": "The reference path."
},
"sources": {
"required": false,
"type": "array",
"description": "An array of globs to determine all sources within the current target.",
"default": [
"**/*.swift"
],
"items": {
"type": "string"
}
},
"compilerArguments": {
"type": "array",
"required": false,
"description": "Additional compiler arguments to be passed.",
"items": {
"type": "string"
}
}
}
}
},
"sde.enable": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -174,6 +213,7 @@
},
"devDependencies": {
"@types/bunyan": "^1.8.4",
"@types/glob": "^5.0.35",
"@types/js-yaml": "^3.11.1",
"@types/node": "^10.1.2",
"@types/xml-js": "^1.0.0",
Expand All @@ -186,6 +226,7 @@
"dependencies": {
"bunyan": "^1.8.5",
"fs-promise": "^1.0.0",
"glob": "^7.1.3",
"js-yaml": "^3.11.0",
"vscode-debugadapter": "^1.25.0",
"vscode-debugprotocol": "^1.15.0",
Expand Down
Loading

0 comments on commit 6c619fd

Please sign in to comment.