GithubHelp home page GithubHelp logo

Comments (24)

gregrobson avatar gregrobson commented on September 22, 2024 2

In case anyone else comes across this: the solution by @hamncheez (close all open files and relaunch ST) worked for me 👍

from sublime-php-grammar.

akrabat avatar akrabat commented on September 22, 2024 1

Yes:

$ cd "Library/Application Support/Sublime Text 3/Packages"
$ git clone [email protected]:gerardroche/sublime-php-grammar.git php-grammar

Start ST3: http://i.19ft.com/dea2332b.png

from sublime-php-grammar.

absalan avatar absalan commented on September 22, 2024 1

I had same issue for while and after little search, someone suggested ro remove CSS3 package. It's seems unrelated but after I removed that package, I got no more error.
Just simply remove CSS3 package from command palette.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

Did you clone it into a folder named "php-grammar"? Though I don't think that should be an issue. I haven't been able to reproduce this error.

from sublime-php-grammar.

akrabat avatar akrabat commented on September 22, 2024

Full output of console:

startup, version: 3092 osx x64 channel: dev
executable: /Applications/Sublime Text.app/Contents/MacOS/Sublime Text
working dir: /
packages path: /Users/rob/Library/Application Support/Sublime Text 3/Packages
state path: /Users/rob/Library/Application Support/Sublime Text 3/Local
zip path: /Applications/Sublime Text.app/Contents/MacOS/Packages
zip path: /Users/rob/Library/Application Support/Sublime Text 3/Installed Packages
ignored_packages: ["PHP", "Vintage"]
ignoring deprecated syntax definition: Packages/SublimeLinter/fixed-syntaxes/HTML/HTML.tmLanguage
ignoring deprecated syntax definition: Packages/SublimeLinter/fixed-syntaxes/Rails/HTML (Rails).tmLanguage
pre session restore time: 0.188089
using gpu buffer for window
first paint time: 0.251901
startup time: 0.27714
error: Error loading syntax file "Packages/PHP/PHP.sublime-syntax": Unable to read Packages/PHP/PHP.sublime-syntax
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.quick_panel
reloading plugin Default.run_all_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.02-bz2
reloading plugin Case Conversion.case_conversion
reloading plugin Case Conversion.case_parse
reloading plugin ChangeQuotes.change_quotes
reloading plugin DashDoc.DashDoc
reloading plugin Directory Settings.DirectorySettings
reloading plugin DocBlockr.__init__
reloading plugin DocBlockr.jsdocs
reloading plugin Gist.gist
reloading plugin Gist.helpers
reloading plugin Gist.request
reloading plugin Gist.settings
reloading plugin GitLink.GitLink
reloading plugin LESS.less_completions
reloading plugin Package Control.bootstrap
reloading plugin Package Control.Package Control
reloading plugin Restructured Text (RST) Snippets.footnotes
reloading plugin Restructured Text (RST) Snippets.headers
reloading plugin Restructured Text (RST) Snippets.helpers
reloading plugin Restructured Text (RST) Snippets.indent_list_item
reloading plugin Restructured Text (RST) Snippets.lists
reloading plugin Restructured Text (RST) Snippets.render
reloading plugin Restructured Text (RST) Snippets.simpleformat
reloading plugin Restructured Text (RST) Snippets.tables
reloading plugin ScopeAlways.ScopeAlways
reloading plugin SideBarEnhancements.SideBar
reloading plugin SideBarEnhancements.SideBarAPI
reloading plugin SideBarEnhancements.SideBarDefaultDisable
reloading plugin SublimeLinter-php.linter
SublimeLinter: php linter loaded 
reloading plugin TrailingSpaces.trailing_spaces
reloading plugin VAlign.valign
reloading plugin WordCount.WordCount
reloading plugin BetterFindBuffer.find_results
reloading plugin php-grammar.plugin
reloading plugin php-grammar.test
reloading plugin SublimeCodeIntel.ordereddict
reloading plugin SublimeCodeIntel.SublimeCodeIntel
reloading plugin SublimeHighlight.SublimeHighlight
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
reloading plugin SublimeLinter-phpcs.linter
SublimeLinter: phpcs linter loaded 
reloading plugin SublimeTableEditor.table_base
reloading plugin SublimeTableEditor.table_border_syntax
reloading plugin SublimeTableEditor.table_emacs_org_mode_syntax
reloading plugin SublimeTableEditor.table_lib
reloading plugin SublimeTableEditor.table_lib_test
reloading plugin SublimeTableEditor.table_line_parser
reloading plugin SublimeTableEditor.table_multi_markdown_syntax
reloading plugin SublimeTableEditor.table_pandoc_syntax
reloading plugin SublimeTableEditor.table_plugin
reloading plugin SublimeTableEditor.table_plugin_test
reloading plugin SublimeTableEditor.table_re_structured_text_syntax
reloading plugin SublimeTableEditor.table_simple_syntax
reloading plugin SublimeTableEditor.table_textile_syntax
reloading plugin SublimeTableEditor.widechar_support
reloading plugin Terminal.Terminal
plugins loaded
SublimeLinter: debug mode: off 
SublimeLinter: phpcs activated: /Users/rob/bin/phpcs 
SublimeLinter: php activated: /usr/local/bin/php 
Package Control: Skipping automatic upgrade, last run at 2015-06-04 12:45:21, next run at 2015-06-04 13:45:21 or after

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

Thanks.

I reproduced a dialog error about the syntax loading when I cloned php-grammar while ST was open. When I restart ST the error goes away, but I'm testing on a clean install of ST without all those plugins. There must be plugin conflict somewhere.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

The latest ST3 dev releases are causing major issues with syntaxes:

http://www.sublimetext.com/forum/viewtopic.php?f=2&t=18613

from sublime-php-grammar.

akrabat avatar akrabat commented on September 22, 2024

I get the error on a completely clean install of ST3 build 3092 with just php-grammar cloned into the Packages folder.

Further testing shows that it happens when I have an open PHP file in my session on start up.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

Yep. I get that too. ST doesn't seem to apply the new syntax properly. Once you close the open files and restart is everything ok?

from sublime-php-grammar.

akrabat avatar akrabat commented on September 22, 2024

Seems so, yes. Thanks.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

Yep. Everytime I open a project that has an existing workspace I get errors and all opened files don't have any syntax highlighting. This is not good.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

I've added a PHP.sublime-syntax version of the language definition for newer versions.

It seems to fix the loading syntax errors. And also fixes some issues with phtml files not being highlighted properly in the newer ST releases.

from sublime-php-grammar.

wbond avatar wbond commented on September 22, 2024

I believe this is a general session serialization "issue" in Sublime Text. The session stores the syntax used, however if you had opened a PHP file, then disable PHP, the syntax will no longer be available when the session is re-loaded.

For instance, Package Control works around this during package upgrades by switching views to Plain Text before upgrading a package containing a syntax def in use. Then after the upgrade, it switches them back. Similar things happen for color schemes and themes.

from sublime-php-grammar.

akrabat avatar akrabat commented on September 22, 2024

Thanks @gerardroche - no more error message!

from sublime-php-grammar.

wbond avatar wbond commented on September 22, 2024

Ok, so the issue was that it wouldn't load the custom PHP.tmLanguage in place of the stock PHP.sublime-syntax?

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

No, it did load PHP.tmLanguage, ST is just throwing dialog errors with the message:

error loading syntax file "Packages/PHP/PHP.sublime-syntax": Unable to read Packages/PHP/PHP.sublime-syntax

It does this whenever there is previous session with open files that had a different syntax definition file applied to it.

For example, if you install a new syntax, open a project and open some files for that syntax, close the project, remove the syntax and now open the project again you get errors about not being able to load the syntax. It's the same error message if you install a syntax that overrides another and do the above steps.

--- edit ---

All the open files with have no syntax highlighting when the error occurs. Once the files are closed and opened the new syntax is applied and everything is ok.

from sublime-php-grammar.

ainstushar avatar ainstushar commented on September 22, 2024

Can we re-open this? I think my issue is similar. Sublime 3083. Installed the plugin, and it complained that php syntax file wasn't available. Restarted Sublime, no syntax highlighting for .php files (status bar indicated that this file was using php syntax). So I am not sure what's going on.

Any way that I can help? Let me know how to provide you with logs.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

@ainstushar open the console Menu > View > Show Console the log is in the console output. Are you on windows, osx, linux? What version of php-grammer do you have? Check by listing the package control packages: Command Palette: Package Control: List Packages.

Also, try closing all open files, then close sublimetext, then open it and open some php files and see if the syntax highlighting is fixed.

from sublime-php-grammar.

ainstushar avatar ainstushar commented on September 22, 2024

Win 7, latest php-grammar (installed it yesterday).

I think I have narrowed down the problem. When php-snippets is enabled, it loses syntax highlighting. When I disable it, and re-open the file, syntax highlighting is back on with php-grammar. I installed all packages (grammar, completions, snippets) yesterday.
Log with php-snippets enabled and I opened a file. I don't see any missing packages. sublimelinter (php) tells me that there are no errors.

DPI scale: 1
startup, version: 3083 windows x64 channel: stable
executable: /C/Program Files/Sublime Text 3/sublime_text.exe
working dir: /C/Program Files/Sublime Text 3
packages path: /C/Users/ainstushar/AppData/Roaming/Sublime Text 3/Packages
state path: /C/Users/ainstushar/AppData/Roaming/Sublime Text 3/Local
zip path: /C/Program Files/Sublime Text 3/Packages
zip path: /C/Users/ainstushar/AppData/Roaming/Sublime Text 3/Installed Packages
ignored_packages: ["CSS", "JSCS-Formatter", "PHP", "SublimeLinter-jscs", "SublimeLinter-jshint", "Vintage"]
pre session restore time: 0.211135
startup time: 0.236135
first paint time: 0.245135
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_file_settings
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.quick_panel
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.02-bz2
reloading plugin All Autocomplete.all_views_completions
reloading plugin AutoFileName.autofilename
reloading plugin AutoFileName.getimageinfo
reloading plugin Color Highlighter.ColorHighlighter
reloading plugin Color Highlighter.colors
reloading plugin CSS3.css3_completions
reloading plugin CSS3.rgb_to_hex
reloading plugin CSS3.validator
reloading plugin DocBlockr.jsdocs
reloading plugin GitGutter.git_gutter
reloading plugin GitGutter.git_gutter_change
reloading plugin GitGutter.git_gutter_compare
reloading plugin GitGutter.git_gutter_events
reloading plugin GitGutter.git_gutter_handler
reloading plugin GitGutter.git_helper
reloading plugin GitGutter.view_collection
reloading plugin GitSavvy.git_savvy
reloading plugin HTML5.encode_html_entities
reloading plugin HTML5.html_completions
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin PackageResourceViewer.package_resource_viewer
reloading plugin PackageResourceViewer.package_resources
reloading plugin php-grammar.plugin
reloading plugin SideBarEnhancements.SideBar
reloading plugin SideBarEnhancements.SideBarAPI
reloading plugin SideBarEnhancements.SideBarDefaultDisable
reloading plugin SublimeLinter-csslint.linter
SublimeLinter: csslint linter loaded 
reloading plugin SublimeLinter-php.linter
SublimeLinter: php linter loaded 
reloading plugin Xdebug Client.main
reloading plugin Autoprefixer.Autoprefixer
reloading plugin Autoprefixer.node_bridge
reloading plugin SublimeCodeIntel.ordereddict
reloading plugin SublimeCodeIntel.SublimeCodeIntel
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
plugins loaded
SublimeLinter: debug mode: on 
SublimeLinter: temp directory: c:\users\ainstushar\appdata\local\temp\SublimeLinter3-ainstushar 
Package Control: Skipping automatic upgrade, last run at 2015-11-03 08:11:34, next run at 2015-11-03 09:11:34 or after
SublimeLinter: computed PATH from system:
C:\Ruby22-x64\bin
C:\ProgramData\Oracle\Java\javapath
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files\nodejs\
C:\HashiCorp\Vagrant\bin
C:\Program Files (x86)\Brackets\command
C:\Users\ainstushar\AppData\Local\Programs\Python\Python35-32\Scripts\
C:\Users\ainstushar\AppData\Local\Programs\Python\Python35-32\
C:\Program Files (x86)\Google\Chrome\Application
C:\ProgramData\Oracle\Java\javapath
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Users\ainstushar\AppData\Local\Programs\Git\cmd
C:\Users\ainstushar\AppData\Local\Programs\Git\mingw64\bin
C:\Users\ainstushar\AppData\Local\Programs\Git\usr\bin
C:\Users\ainstushar\AppData\Local\atom\bin
C:\Users\ainstushar\.babun
%SUBLIME%
%appdata%\npm
C:\Program Files\nodejs
C:\Users\ainstushar\AppData\Local\php-5.6
C:\Users\ainstushar\node_modules\.bin\
C:\Users\ainstushar\AppData\Roaming\npm
C:\Program Files (x86)\Microsoft VS Code\bin
C:\Users\ainstushar\AppData\Local\nylas\bin

SublimeLinter: csslint version query: C:\Users\ainstushar\AppData\Roaming\npm\csslint.cmd --version 
SublimeLinter: csslint version: 0.10.0 
SublimeLinter: csslint: (>= 0.10) satisfied by 0.10.0 
SublimeLinter: csslint activated: C:\Users\ainstushar\AppData\Roaming\npm\csslint.cmd 
SublimeLinter: php activated: C:\Users\ainstushar\AppData\Local\php-5.6\php.exe 
SublimeLinter: chdir not set or invalid, using C:\Users\ainstushar\Documents\GitHub\DoctorD\wp-content\themes\drd 
SublimeLinter: php: header.php ['C:\\Users\\ainstushar\\AppData\\Local\\php-5.6\\php.exe', '-l', '-n', '-d', 'display_errors=On', '-d', 'log_errors=Off'] 
SublimeLinter: php output:
No syntax errors detected in - 

Hopefully this helps.

from sublime-php-grammar.

ainstushar avatar ainstushar commented on September 22, 2024

Actually ignore above part. It seems that some files have syntax highlighting and some don't. php-snippets doesn't seem to be the issue. I think the issue is related to HTML syntax highlighting in .php files.

Example: I got 2 files. functions.php and header.php. Sublime's php is disabled, your grammar, snippets, and completions are enabled. There is syntax highlighting in functions.php but not in header.php. header.php mostly contains HTML vs functions.php has no HTML. Shouldn't php-grammar have HTML syntax highlighting? I have to manually select HTML syntax highlighting when I open .php files. Is the solution to open all php files with HTML syntax on? Because sublime will do syntax highlighting just fine for php components with HTML syntax styling enabled.

Sorry for the confusion. Please let me know if there are any questions.

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

@ainstushar This is fixed in the latest ST build: 3095. The way language syntaxes are handled in ST has been rewritten. In ST versions prior to 3084 the HTML syntax was the default syntax for php files. In >= 3084 this has been fixed. It's not possible for php-grammar to fix it. If you can, use the latest build 3095, it has so many more fixes. Also, many php-grammar fixes and improvements will only work in >=3095. See #39 and https://github.com/gerardroche/sublime-php-grammar/blob/master/CHANGELOG.md

from sublime-php-grammar.

ainstushar avatar ainstushar commented on September 22, 2024

Yep, it works on 3095. Thanks for the thorough and detailed response. :)

from sublime-php-grammar.

hamncheez avatar hamncheez commented on September 22, 2024

Build 3103 not working. All php autocompletes not working, no syntax highlighting in .php files, but works fine in .html , .phtml , and .ctp files. Uninstalled/reinstalled sublime, php-grammar, still no luck. Any ideas?

from sublime-php-grammar.

gerardroche avatar gerardroche commented on September 22, 2024

@hamncheez the native php completions and snippets are disabled when you install php-grammar. They are provided as individual packages: PHP Completions and PHP Snippets. See the PHP Grammar installation guide.

@hamncheez the no syntax highlighting issue in .php files. Does the issue persist after you close all open views and then restart Sublime Text?

from sublime-php-grammar.

Related Issues (20)

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.