GithubHelp home page GithubHelp logo

sublimetext / qml Goto Github PK

View Code? Open in Web Editor NEW
28.0 8.0 4.0 253 KB

QML support for Sublime Text and Sublime Merge

License: MIT License

QML 100.00%
sublime-text syntax-highlighting sublime-snippets sublime-text-package qml

qml's Introduction

logo

QML for Sublime Text

Syntax Tests Package Control

About

This is a Sublime Text & Sublime Merge package that adds support for the Qt/QML ecosystem.

This package provides the following features:

  • Complete syntax highlighting for QML and qmldir files.
  • GoTo indexing for ids, property declarations and inline components.
  • Snippets for commonly used properties and types.

If you are a KDE developer, check out kdesrc-build plugin for Sublime Text as well!

Installation

The easiest way is to install it from Package Control.

  • Install Package Control itself, if you haven't done already
  • Open up the command palette: Ctrl+Shift+P (Linux, Windows) / Cmd+Shift+P (OS X)
  • Search for Package Control: Install Package
  • Search for QML
  • Hit Enter

Using Git

Go to your Sublime Text Packages directory and clone the repository using the command below:

$ git clone https://github.com/SublimeText/QML

Manual Download

  • Download the files using the .zip download option
  • Unzip the files (and rename the folder to QML if needed)
  • Copy the folder to your Sublime Text Packages directory

License

This package is licensed under the MIT License.

qml's People

Contributors

ratijas avatar skozlovf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qml's Issues

Explicit enum values are not supported

There's currently lacking support for explicit enum values inside QML enum declaration:

QtObject {
    enum Color {
        White = 1,
        Orange,
        Green,
        Red,
        Blue,
        Yellow
    }
}

the = 1 part isn't recognized at all:

image

Recover from ":" semicolon after an Uppercase property name

Apparently, with custom parser it is legal to have Uppercase property names in QML:

    ListModel {
        id: baseModel
        ListElement {
            Description: "Us"
        }
        ListElement {
            Description: "Them"
        }
    }

But currently the rules that process property names aren't stopping at semicolon or at "}" closing braces, resulting in broken syntax and unclosed meta.block contexts/scopes:

image

env setting in qml.sublime-build prevents from finding qmlscene

the line:

"env": {"PATH": "D:\\work\\cpp\\libs\\qt-5.1.0\\5.1.0\\msvc2010\\bin"},

prevents sublime from finding sqmlscene if it is installed in a different dir.
Although the docs say that sublime will merge the env variables, it seems that it overrides them instead.

When I removed the line, the build works fine

Refactor builtin/support types and constants out of main file

In CMake syntax all the builtin/support names are contained in an auto-generated file, separately from the main syntax highlight definitions. Something similar could be done to QML syntax, considering most it now is just boilerplate of support- contexts.

Hang on paste

I'm using Sublime-QML in Sublime Text 3.

I'm getting strange hanging behavior occasionally when pasting. Sometimes it hangs for several moments when I paste, sometimes it hangs permanently.

I can reproduce the error on the following:

Create a test.qml file with the following content:

PropertyChanges { target: projectTypeListView; height: projectTypesEditorView.height + 1; opacity: 1; }

Copy the "projectTypesEditorView" text then try to paste it directly after itself before the '.' So that it would look like:

PropertyChanges { target: projectTypeListView; height: projectTypesEditorViewprojectTypesEditorView.height + 1; opacity: 1; }

Sublime Text will hang.

SublimePySide

Hi.

I found your plugin today in Package Control, I don't know if you are aware of my own plugin to work with Qt (PyQt and PySide) in Sublime Text 2 and 3. You can find it in: https://github.com/DamnWidget/SublimePySide

I'm just writting this because you didn't specified any type of LICENSE for this plugin I was just wondering if I can reuse it in SublimePySide or better if you can contribute with SublimePySide yourself.

Good work by the way.

Regards.

Maintenance

Hi Sergey,

I'm an active KDE developer, and a heavy user of Sublime Text. As such, I'd like to request that you grant me maintainer permissions for this project โ€” QML integration for Sublime Text & Merge.

My goals are, first and foremost, fix and update syntax definitions to support modern QML features, and also possibly integrate it with LSP created by other developer of our community.

Worst case scenario: I'll have to fork it and re-publish as a new package. Best case scenario: we could transfer this repo under Sublime Text Packages GitHub organization.

Build system only shows command line but no GUI

my platform is win7, sublime text 3
After I pressed Ctrl+B, I can only see the console with some error message or nothing, but the GUI did not show.
If I use cmd,"qmlscene file_path", everything is OK.
All my settings with this plugin is default. I am so confused and could not find any similar question.
I have removed my sublime's package folder, reinstalled package control, reinstalled QML. But still got the same problem.

QML/JS extension: `object as Type` type hints ("as-casting")

Another lesser known feature of QML: type hints inside expressions. Their syntax uses as keyword with object/expression on the left and type name on the right. For example:

    property QtObject foo: self()
    property real foox: (foo as Item).x

This feature is so rare, it only has three tests in whole qtdeclarative repo. And I've never seen in it in the wild.

image

Interestingly, KDE Syntax Highlighting definition for QML (and by extension Kate, KDevelop etc) supports "as-casting" accidentally: it treats "as" as a keyword in any JavaScript context, just because it is already being used for js module imports.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.