Хочу вот поделиться бетой Может кому и покажется удобным работать со Sciter в VSCode.
На данный момент есть Sciter-specific подсветка CSS, Html, TIScript. Автодополнение в CSS (включая @mixin и @const) и TIScript (только для объектов Element, то есть для идентификаторов this и el*).
Самое главное, можно сразу из VSCode открыть документ в Sciter (Ctrl-K, Ctrl-S), посмотреть что получается
Неспешно пишется для себя, поэтому только под Windows. Если будут желающие, можно пересобрать и для Mac\Linux.
Здравствуйте, Conr, Вы писали:
C>Привет,
C>Хочу вот поделиться бетой Может кому и покажется удобным работать со Sciter в VSCode. C>На данный момент есть Sciter-specific подсветка CSS, Html, TIScript. Автодополнение в CSS (включая @mixin и @const) и TIScript (только для объектов Element, то есть для идентификаторов this и el*). C>Самое главное, можно сразу из VSCode открыть документ в Sciter (Ctrl-K, Ctrl-S), посмотреть что получается
C>Image: screenshot.png
C>Неспешно пишется для себя, поэтому только под Windows. Если будут желающие, можно пересобрать и для Mac\Linux.
Прикольно только не завелось чего-то. Visual Code написал "The Sciter server server crashed 5 times in the last 3 minutes. The server will not be restarted.". Windows 10, последний Code.
Здравствуйте, c-smile, Вы писали:
CS>Прикольно только не завелось чего-то. Visual Code написал "Sciter server server crashed 7 times". Windows 10, последний Code.
Упс, отладочную версию выложил случайно Пытается в c:\temp\ писать
Обновил файл, можно переустанавливать (только вначале удалить предыдущую версию).
CS>В частности .tis файл открыть могу но на 'this' code completion нет. CS>В html <script type="text/tiscript"> не подсвечивается...
А workspace настроен? VSCode идет со своей поддержкой css и html, чтобы их заменить нужно либо прописать в settings.json ( https://code.visualstudio.com/Docs/customization/userandworkspace ):
Либо каждый раз выбирать Language Mode:
или нажать Ctrl + K, M
или в строке статуса (справа) щелкнуть Select Language Mode
Для html нужен "Sciter Html", для CSS "Sciter CSS".
C>>Брать тут: https://www.conrlab.com/sciter-assistant-beta.html CS>Там у тебя лежит zip файл, а нужен vsix как я понимаю.
Так там .vsix и лежит. Впрочем это zip и есть, просто с другим расширением.
Возможно дело в том, что отдается файл как mimeType="application/octet-stream". Edge пытается быть слишком умным и подменяет расширение на .zip.
В Chrome такой проблемы нет.
Здравствуйте, c-smile, Вы писали:
CS>Там не хватат event declaration:
Попустил. Сам event functions еще не пользовался. Добавлю.
CS>Если положишь на GitHub или еще куда то могу это всё пополнять...
Выложил syntax файлы тут: https://github.com/svitalij/sciter.tm.syntax
Редактриую я *.YAML-tmLanguage, из них уже с помощью TextMate Languages получаю *.tmLanguage, который понимает VSCode.
Кстати, по идее, полученные .tmLanguage файлы можно отдавать любому редактору, который поддерживает TextMate Syntax templates.
А это Atom, Sublime ну и сам TextMate, естественно.
Здравствуйте, Conr, Вы писали:
C>Кстати, по идее, полученные .tmLanguage файлы можно отдавать любому редактору, который поддерживает TextMate Syntax templates. C>А это Atom, Sublime ну и сам TextMate, естественно.
На самом деле Sublime более интересно. Code тормозит.
Если бы кто изложил инструкцию как это подсунуть Sublim'у было бы зашибись.
Здравствуйте, c-smile, Вы писали:
CS>На самом деле Sublime более интересно. Code тормозит.
У меня ровно наоборот
CS>Если бы кто изложил инструкцию как это подсунуть Sublim'у было бы зашибись.
Для Sublime 3:
меню Preferences/Browse Packages... — откроется папка, которую в доках Sublime называют "<data_path>/Packages"
Создаем в ней папку Sciter и копируем в неё все *.tmLanguage.
Готово
*.tis файлы подцепляются автоматом. Для CSS и HTML нужно выбрать View->Syntax->Sciter->Sciter CSS\HTML. Получается как-то так:
Если кто захочет приделать автодополнение в Sublime, то это даже проще, чем в VSCode. Он умеет использовать информацию о регионах, полученную из *.tmLanguage, вручную парсить код не нужно.
Но у меня VSCode работает шустрее всех из (Atom|Brackets|Sublime|VSCode), поэтому пока я только с ней вожусь.
Здравствуйте, c-smile, Вы писали: CS>Если кто-то может поделиться алгоритмом создания auto completion definitions для Sublime или VS Code — не стесняйтесь
В обоих случаях принцип примерно одинаковый: в плагин приходит только местоположение в тексте (строка, позиция в строке), исходники нужно парсить самостоятельно и отдавать список с подстановками.
{
"Type": "Element",
"Constants": [
{
"Name": "STATE_LINK"
},
{
"Name": "STATE_HOVER"
},...
]
"Properties": [
{
"Name": "length",
"Comment": "Number of child elements in this element.",
"Type": "Integer"
},
{
"Name": "root",
"Comment": "Root element of the DOM this element belongs to.",
"Type": "Element"
},...
]
"ClassMethods": [
{
"Name": "create",
"Signature": "(object) : Element",
"Comment": "Static constructor of DOM elements. Object here is an object literal with microformat defined at http://sciter.com/docs/content/sciter/Element.htm",
}
],
"Methods": [
{
"Name": "clear",
"Comment": "Clears a content of the element, removing all its children.",
"Signature": "() : undefined",
},
{
"Name": "toString",
"Comment": "Returns string - html representation of the element. Text returned is outer html - includes head and tail tags and content s equal to text returned by В html attribute.",
"Signature": "() : String",
},...
]
}
CS>Что-то за час попыток ничего не получилось. Как-то мутно всё там.
Да, в общем-то, не rocket-science. вот например
dd_container = el.pa|rent.selectParent(def.container);
^ тут курсор был
лог взаимодействия с VSCode
>>>>>>:
{
"id": 4,
"jsonrpc": "2.0",
"method": "textDocument/completion",
"params": {
"position": {
"character": 26,
"line": 88
},
"textDocument": {
"uri": "file:///c%3A/Projects/HexEdit/SciterHex/GUI/ddm.tis"
}
}
}
<<<<<<:
{
"id": 4,
"jsonrpc": "2.0",
"result": {
"isIncomplete": false,
"items": [
{
"documentation": "Parent element of given element or null if this element is a root element.",
"kind": 10,
"label": "parent",
"textEdit": {
"newText": "parent",
"range": {
"end": {
"character": 30,
"line": 88
},
"start": {
"character": 24,
"line": 88
}
}
}
},
{
"documentation": "null | function(gfx), assigns background layer painting function. The function gets Graphics object that is used to draw the layer. If the function returns true then default background and borders drawing is suppressed. The background drawing function is drawn before native background drawing.",
"kind": 10,
"label": "paintBackground",
"textEdit": {
"newText": "paintBackground",
"range": {
"end": {
"character": 30,
"line": 88
},
"start": {
"character": 24,
"line": 88
}
}
}
},
{
"documentation": "null | function(gfx), assigns content layer painting function. The function gets Graphics object that is used to draw the layer. If the function returns true then default content drawing is suppressed. The content drawing function gets invoked before native content drawing.",
"kind": 10,
"label": "paintContent",
"textEdit": {
"newText": "paintContent",
"range": {
"end": {
"character": 30,
"line": 88
},
"start": {
"character": 24,
"line": 88
}
}
}
},
{
"documentation": "null | function(gfx), assigns foreground layer painting function. The function gets Graphics object that is used to draw the layer. If the function returns true then default foreground drawing is suppressed. The content drawing function gets invoked before native foreground drawing.",
"kind": 10,
"label": "paintForeground",
"textEdit": {
"newText": "paintForeground",
"range": {
"end": {
"character": 30,
"line": 88
},
"start": {
"character": 24,
"line": 88
}
}
}
},
{
"documentation": "null | function(gfx), assigns outline layer painting function. The function gets Graphics object that is used to draw the layer. If the function returns true then default outline drawing is suppressed. The outline drawing function gets invoked before native outline drawing.",
"kind": 10,
"label": "paintOutline",
"textEdit": {
"newText": "paintOutline",
"range": {
"end": {
"character": 30,
"line": 88
},
"start": {
"character": 24,
"line": 88
}
}
}
}
]
}
}
www.conrlab.com uses an invalid security certificate. The certificate expired on 9 марта 2017 г. 15:30. The current time is 17 марта 2017 г. 8:43. Error code: SEC_ERROR_EXPIRED_CERTIFICATE
www.conrlab.com uses an invalid security certificate. The certificate expired on 9 марта 2017 г. 15:30. The current time is 17 марта 2017 г. 8:43. Error code: SEC_ERROR_EXPIRED_CERTIFICATE