Commit Graph

184 Commits

Author SHA1 Message Date
Keith Smiley
00175433c5 Add syntastic integration to the readme 2016-06-04 16:00:02 -07:00
Keith Smiley
b73c0ba24d Only enable swiftlint checker with config file
This means that if you just have swiftlint installed, it won't be
enabled automatically. You either need a `.swiftlint.yml` or you need to
set `g:syntastic_swift_swiftlint_use_defaults` to 1 in your vimrc.
2016-06-04 15:43:18 -07:00
Keith Smiley
3cd476dc68 Merge pull request #97 from keith/ks/swiftlint-syntastic
Add swiftlint syntastic checker
2016-06-04 15:28:15 -07:00
Keith Smiley
ae059d99e6 Add swiftlint syntastic checker 2016-06-04 15:27:40 -07:00
Keith Smiley
9f9f8f27f0 Merge pull request #96 from keith/ks/swiftpm-syntastic
Add syntastic syntax checker using swiftpm
2016-06-04 15:27:21 -07:00
Keith Smiley
0d8ef6d688 Add syntastic syntax checker using swiftpm
This allows projects using swift package manager to get inline errors
with syntastic.

You can customize the main executable, or the arguments passed to it,
through global configuration variables.
2016-06-04 14:22:39 -07:00
Keith Smiley
5b5eb2ed9c Merge pull request #95 from keith/kylef/ctags
Add ctags and Tagbar configuration
2016-06-02 15:53:47 -07:00
Kyle Fuller
5d5f81483d Add ctags and Tagbar configuration
Closes #74
2016-06-02 14:43:39 -07:00
Keith Smiley
59282ab334 Merge pull request #91 from raimon49/support-underscore-in-integer-literals
Add match pattern underscore to hex, binary, octal literals
2016-05-08 13:19:41 -07:00
raimon
08016710f2 Add match pattern underscore to hex, binary, octal literals
See also:
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html
2016-05-08 16:42:59 +09:00
Keith Smiley
b0aac5c967 Merge pull request #86 from keith/ks/indirect-case
Only highlight indirect when followed by case
2016-04-24 13:56:04 -07:00
Keith Smiley
345b2705ef Merge pull request #87 from keith/ks/force-filetype
Force swift filetype for `*.swift` files
2016-04-24 13:55:52 -07:00
Keith Smiley
2685d9e521 Force swift filetype for *.swift files
This fixes an issue where files would occasionally be interpreted as
`conf` files
2016-04-24 13:52:27 -07:00
Keith Smiley
b4262ec767 Only highlight indirect when followed by case 2016-04-24 13:50:37 -07:00
Keith Smiley
3efa034dda Merge pull request #84 from ajh17/typecasts
Add syntax highlighting for type casts
2016-04-24 13:41:58 -07:00
Keith Smiley
7280cb821d Merge pull request #85 from ajh17/interpolated-string-fix
Interpolated string fix
2016-04-24 13:40:36 -07:00
Akshay Hegde
bb98df4563 Fix syntax coloring in string interpolation
Start the match just before the \( part
2016-04-24 13:36:22 -07:00
Akshay Hegde
a2cca58680 Add syntax highlighting for type casts
This commit separates `as` and `is` into their own keyword syntax,
and contains them in a new syntax region for type casts.

Also removes an extraneous `swiftGenericsWrapper` in the `swiftType`
syntax match.

Fixes #48
2016-04-24 13:22:04 -07:00
Keith Smiley
9fb609e321 Merge pull request #82 from ajh17/selector-syntax
Highlight #selector keyword [SE-0022]
2016-04-24 11:44:57 -07:00
Keith Smiley
5d9d8de8e9 Merge pull request #83 from ajh17/swift-property-highlight
Implement highlighting for properties and enum members
2016-04-24 11:43:51 -07:00
Akshay Hegde
d23e21ce38 Implement highlighting for properties and enum members 2016-04-24 11:43:31 -07:00
Akshay Hegde
03140ad483 Highlight #selector keyword [SE-0022]
From swift-evolution:
https://github.com/apple/swift-evolution/blob/master/proposals/0022-objc-selectors.md
2016-04-24 11:43:10 -07:00
Keith Smiley
0fe633bfcd Merge pull request #81 from dduan/highlight_line_directive
highlight Swift line directive [SE-0034]
2016-03-01 21:48:22 -08:00
Daniel Duan
328a7c3a4c highlight Swift line directive [SE-0034] 2016-03-01 01:12:23 -08:00
Keith Smiley
10b0d1b7b8 Merge pull request #80 from dduan/add_swift_builtin_expr
highlight Swift builtin debug identifiers
2016-02-22 15:45:42 -08:00
Daniel Duan
1817bc4240 highlight Swift buildtin expressions 2016-02-22 15:31:19 -08:00
Keith Smiley
a7afa7ddd5 Merge pull request #79 from dduan/master
add 'associatedtype' as a keyword
2016-02-12 15:50:11 -08:00
Daniel Duan
b5c249e9ab add 'associatedtype' as a keyword 2016-02-12 15:49:02 -08:00
Keith Smiley
41d75c07bd Make swiftInterpolatedWrapper only span a single line
This is part of the language and previously broken syntax highlighting
broken everything below it as well. Now the highlighting is fixed as
well. It was fallout from changing the type wrapper to contain ALL.
2016-02-08 15:08:43 -08:00
Keith Smiley
7d7c6e33ba Add failing indention case 2016-01-08 19:13:10 -08:00
Keith Smiley
5258bd9892 Swift strings are only allowed to be on a single line
Before the match could go on forever
2016-01-08 16:40:25 -08:00
Keith Smiley
b583247fd7 Allow nested strings in interpolated strings
Previously this broke all following syntax highlighting because it
thought it was continuing a string
2016-01-08 16:38:51 -08:00
Keith Smiley
f2ce1a39a9 Handle multiple closure indents 2016-01-08 16:35:23 -08:00
Keith Smiley
624e1a4778 Remove comment special casing
I don't know what I was thinking with this. Previously all comment lines
would indent as the line above them. This doesn't work because of many
cases such as:

```swift
if foo {
  // something
}
```

Previously this comment would be forced on to column 0. Now comments are
indented as everything else.
2016-01-08 16:26:46 -08:00
Keith Smiley
8d5578d417 Fix multiline paren indenting
This fixes the python-style indenting that was previously done. If you
had a codeblock like this:

```swift
let foo = Thing(arg: arg,
                arg2: arg2)
```

The indent of the second line would be the opening paren +1. This has
changed to:

```swift
let foo = Thing(arg: arg,
    arg2: arg2)
```

Which is the indent of the opening paren line +1 'shiftwidth'
2016-01-08 16:21:37 -08:00
Keith Smiley
7db0cb4226 Fix closing square bracket indent
This fixes the case where the closing square bracket of something (like
an array) is on the same line as an entry, so it should be indented one
level above the opening square bracket
2016-01-08 15:46:54 -08:00
Keith Smiley
fa61881d9c Everything contains everything!
This can't possibly be true. But right now somethings haven't been
highlighted correctly because the wrapper types have been blocking them.
Now these are explicitly marked as containing ALL, which works in the
example.swift file. I'm sure we're going to have to back this off, and
we'll do that case by case.
2016-01-08 14:51:04 -08:00
Keith Smiley
d87608dcd1 Operators also should be highlighted in literals 2016-01-08 14:46:20 -08:00
Keith Smiley
7081de3cbe Literal wrappers can contain methods
This fixes a bug where a method call with a trailing [] would be
highlighted incorrectly because a different match trumped the function
call.
2016-01-08 14:42:33 -08:00
Keith Smiley
66474b647a Single forward slash terminates type wrappers
This fixes a problem where comments at the end of a line could be
contained in the highlighting of the prefix. Now matches end 1 character
before their "actual" end
2016-01-08 14:37:03 -08:00
Keith Smiley
72ec3f8df3 Reindent switch statement cases with : 2016-01-08 13:04:00 -08:00
Keith Smiley
98cb48e309 Add new swift comment identifiers 2016-01-08 12:57:22 -08:00
Keith Smiley
3429aa2e7e Merge pull request #70 from gfontenot/gf-remove-indentation
Remove indentation settings
2015-10-20 13:34:59 -07:00
Gordon Fontenot
c18e48c756 Remove indentation settings
These are overly prescriptive. We should just rely on the user's
settings.
2015-10-20 14:26:30 -05:00
Keith Smiley
091fbad512 Fix indent picking wrong brackets 2015-10-18 18:00:17 -07:00
Keith Smiley
39a5abebed Handle more indention cases, now without smartindent
Closes #66
2015-10-18 16:49:15 -07:00
Keith Smiley
c22863f258 Enforce smartindent
This is currently needed for indention while typing to work correctly.

See #66
2015-10-18 15:55:54 -07:00
Keith Smiley
f6279335a4 Fix broken syntax checking
I updated this function without getting the actual line and column
numbers, just passing .
2015-10-18 15:54:43 -07:00
Keith Smiley
51777f39d5 Fix ] indent issue
Previously when you typed, or tried to reindent a ] character, it didn't
work. This was because the brackets weren't escaped in search pair. This
also fixes auto indenting when typing the close square bracket. This is
now special cased because search pair returns no matches right after
typing the bracket.
2015-10-18 14:39:53 -07:00
Keith Smiley
5e77f97c4d Force vim to sync 100 lines
This fixes a bug where if you had a very long documentation comment, and
you launched vim and it resumed with only being able to see a portion of
that comment, the comment would not be highlighted correctly. By default
ruby syncs 500 lines so we could probably up this number if needed, but
this should be fine for now.

Closes #49
2015-10-18 13:22:18 -07:00