Commit Graph

183 Commits

Author SHA1 Message Date
John Sundell dc83f92228 Highlight ‘self’ as keyword when used to refer to a type
This patch fixes syntax highlighting when using `.self` to refer to a type.
2018-08-27 18:44:07 +02:00
John Sundell 1faa928214 Correctly highlight subscript declarations
This patch fixes syntax highlighting when declaring
a subscript:

```
struct MyStruct {
	subscript(key: Key) -> Value? {
		…
	}
}
```
2018-08-27 18:32:22 +02:00
John Sundell fd160ba1ef
Merge pull request #10 from JohnSundell/enum-subscripting
Highlight enums used as subscripting keys
2018-08-27 18:21:07 +02:00
John Sundell a86694802e Highlight enums used as subscripting keys
This patch fixes highlighting when an enum is used as a dictionary key, like this:

```
let value = dictionary[.key]
```
2018-08-27 18:14:17 +02:00
John Sundell b61a641be7
Merge pull request #9 from JohnSundell/html-escaping
HTMLOutputFormat: Escape < and > characters
2018-08-27 00:22:42 +02:00
John Sundell c73767a0bc HTMLOutputFormat: Escape < and > characters
This patch makes `HTMLOutputFormat` correctly escape all < and > characters
that occur in source code. Otherwise, a web browser rendering the resulting
HTML will interpret those characters as tags.
2018-08-27 00:14:48 +02:00
John Sundell b892feae14
Merge pull request #8 from JohnSundell/static-generic-calls
Correctly handle static methods called on a generic type
2018-08-27 00:12:38 +02:00
John Sundell be35cef1ea Correctly handle static methods called on a generic type
This patch fixes syntax highlighting for the following scenario:

```
Type<GenericType>.call()
```

Highlighting generic types is especially tricky, since we want them to
be highlighted when appearing at the call site, like above - but we don’t
want to highlight them when they are being declared. Hopefully with this
fix all/most edge cases are covered.
2018-08-27 00:10:08 +02:00
John Sundell f8523e3360
Merge pull request #7 from JohnSundell/remove-custom-color
Replace custom Color struct with typealiases
2018-08-26 23:15:19 +02:00
John Sundell aea685e8b4 Color: Exclude internal extension on Linux 2018-08-26 22:57:02 +02:00
John Sundell a68e461eb4 Replace custom Color struct with typealiases
Now that the decision not to support colors on Linux
has been made, we can replace the custom `Color` struct
with simple typealiases for `NSColor` and `UIColor`.

The same can’t be done for font, since we want to enable
loading of a font from a path, for SPM packages.
2018-08-26 22:49:39 +02:00
John Sundell 62a517bade
Merge pull request #6 from JohnSundell/fix-sundells-colors
Fix Sundell’s Colors theme colors
2018-08-26 14:18:58 +02:00
John Sundell 0155f41ceb Fix Sundell’s Colors theme colors
Seem to have been mixed up when moved to the new Defaults extension.
2018-08-26 14:15:47 +02:00
John Sundell 56acd53824
Merge pull request #5 from JohnSundell/linux-ci
Add Linux CI using Travis
2018-08-26 01:16:15 +02:00
John Sundell 387d2e44f0 Add Linux CI using Travis
We’re using Bitrise for Mac builds, but for Linux let’s
use Travis to make sure we don’t cause regressions on Linux.
2018-08-26 01:05:51 +02:00
John Sundell 0ec69daecd
Merge pull request #4 from JohnSundell/cross-platform-fix
Streamline cross-platform implementation
2018-08-26 01:03:58 +02:00
John Sundell 530cdad12f Disable Theme+Defaults on Linux 2018-08-26 00:59:22 +02:00
John Sundell df73f6d066 Disable Color + Theme on Linux
They don’t really make sense, since there’s no way
to use them on Linux, without linking to some form
of Linux rendering framework.
2018-08-26 00:58:23 +02:00
John Sundell 1e532a6c4c Theme: Streamline cross-platform implementation
Now that we’re making Splash support iOS as well as
Mac + Linux, we need to create some nice abstractions
to make sure that we can share as much code as possible
between all platforms.

- Define Font.Loaded and Color.Renderable as platform-
specific typealiases for system fonts and colors.
- Don’t compile in non-Linux compatible code when building
for Linux.
- Make Font and Color handle all conversion themselves, so
that AttributedStringOutputFormat can be kept more clean.
2018-08-26 00:54:44 +02:00
John Sundell c7d50e6d9b
Merge pull request #3 from myurieff/master
Implements iOS support for AttributedStringOutputFormat
2018-08-25 23:31:37 +02:00
Mihael Cholakov dfd146dadb Removed whitespace 2018-08-25 23:37:24 +03:00
Mihael Cholakov 3952b91e3f Removed whitespace 2018-08-25 23:36:19 +03:00
Mihael Cholakov d57b233f3e Merge branch 'master' of https://github.com/myurieff/Splash 2018-08-25 23:32:05 +03:00
Mihael Cholakov 128f0929d4 Moved Sundell theme to Defaults 2018-08-25 23:24:10 +03:00
Mihael Cholakov d6a327c831 Adds additional premade themes 2018-08-25 23:22:54 +03:00
Mihael Cholakov 305d09e8ac Whitespace removal 2018-08-25 22:11:20 +03:00
Mihael Cholakov def9e10f1a Shortened loadFont 2018-08-25 22:06:05 +03:00
Mihael Cholakov 5702cea843 Implements iOS support for AttributedStringOutputFormat 2018-08-25 21:49:30 +03:00
John Sundell 74a6e3bcfa
Merge pull request #2 from JohnSundell/example-css
Add example CSS file matching Sundell’s Colors
2018-08-25 20:48:06 +02:00
John Sundell 9c1fdd358d Add example CSS file matching Sundell’s Colors
This change adds an example CSS file to a new /Examples folder, which
shows what kind of CSS classes that Splash uses when generating HTML.
2018-08-25 20:34:39 +02:00
John Sundell 54598263bb
Merge pull request #1 from JohnSundell/function-call-property-fix
Correctly highlight properties after function calls
2018-08-25 13:00:29 +02:00
John Sundell 896a56b682 Correctly highlight properties after function calls
This patch fixes highlighting in the following scenarios:

```
call().property
call(argument).property
```
2018-08-25 12:56:34 +02:00
John Sundell 8645db8de0 Initial commit 2018-08-24 18:42:07 +02:00