• sublime text3的php代码合法检查


    1.使用 ctrl+shit+p 来输入 package Control:Install Package来安装;

    2.安装好后在弹出框继续输入 SublimeLinter;

    3.自动安装好 SublimeLinter 后 ,输入 SublimeLinter-php来安装;

    4.全部安装好后会有:

    5.然后点击 4  这个截图下的路径,然后输入以下内容:(改下paths下的windows,在这里输入php应用程序的路径即可)

    {

    // Set to true to print extra information in the console.
    "debug": false,

    // When in the "background" lint mode, this value determines
    // the minimum delay before a request is send to the linter
    "delay": 0.25,

    // Available gutter themes:
    // - Blueberry Cross
    // - Blueberry Round
    // - Circle
    // - Danish Royalty
    // - Default
    // - Hands
    // - Knob
    // - Knob Symbol
    // - Koloria
    // - ProjectIcons
    // Note that you may need to change the "icon" property in "styles"
    // to an icon in the theme (they usually include "warning" and "error")
    "gutter_theme": "Default",

    // Demote the visibility of a class off errors while you're editing.
    // The errors will re-appear after `time_to_idle` and immediately on save.
    // - ws_regions: erroneous regions that contain whitespace
    // - warnings: errors of the "warning" type
    // - all: demote all the things
    // - none: disable this feature
    "highlights.demote_while_editing": "none",

    // Apply a color (via scope) to the demoted errors.
    // E.g. "" will hide the errors, "comment" is usually a subtle color.
    "highlights.demote_scope": "",

    // How long to wait before showing the demoted errors again.
    "highlights.time_to_idle": 1.5,

    // Send a "terminate" signal to old lint processes, if their result would
    // be thrown away. If false we fire-and-forget processes instead.
    "kill_old_processes": false,

    // Lint Mode determines when the linter is run.
    // - background: asynchronously on every change
    // - load_save: when a file is opened and every time it's saved
    // - manual: only when calling the Lint This View command
    // - save: only when a file is saved
    "lint_mode": "background",

    // Linter specific settings.
    // More info: http://www.sublimelinter.com/en/stable/linter_settings.html
    // Linter specific settings except for "styles" can also be changed
    // in sublime-project settings.
    // What settings are available is documented in the readme of the
    // specific linter plugin.
    // Example:
    // "linters": {
    // "somelinter": {
    // "disable": false,
    // "args": [],
    // "excludes": [],
    // "styles": [
    // {
    // "icon": "diamond"
    // }
    // ]
    // },
    // "somepythonlinter": {
    // "python": null,
    // "disable": false,
    // "args": [
    // "--max-complexity", "-1",
    // "--max-line-length", "100",
    // "--ignore", "E731,E402"
    // ],
    // "excludes": [],
    // }
    // }
    "linters": {
    "csslint": {
    "@disable": false,
    "args": [],
    "errors": "",
    "excludes": [],
    "ignore": "",
    "warnings": ""
    },
    "htmlhint": {
    "@disable": false,
    "args": [],
    "excludes": []
    },
    "jshint": {
    "@disable": false,
    "args": [],
    "excludes": []
    }
    },

    // Determines what happens when a linter reports a problem without column.
    // By default, a mark is put in the gutter and the first character is highlighted.
    // If this setting is true, the entire line is also highlighted.
    "no_column_highlights_line": false,

    // Provide extra paths to be searched when locating system executables.
    "paths": {
    "linux": [],
    "osx": [],
    "windows": [
    "D:\phpStudy\php55"
    ]
    },

    // Show a report for problems on a line by hovering over the gutter.
    "show_hover_line_report": true,

    // Show a report for problems on a region by hovering over it.
    "show_hover_region_report": true,

    // Highlight problems in the minimap.
    "show_marks_in_minimap": true,

    // Show the output panel on save if there are problems.
    // - window: check if the window has problems.
    // - view: only check the current file.
    // - never: disable this feature.
    "show_panel_on_save": "never",

    // Display counters in the status bar.
    // The {}'s will be replaced by warnings and errors respectively.
    // Example alternative: (w:{}, e:{})
    "statusbar.counters_template": "({}|{})",

    // Show the messages for problems at your cursor position.
    // - {message} will be replaced by the actual messages.
    // - {linter} will be replaced by the linter reporting the error.
    // - {type} will be replaced by either warning or error.
    // - {code} will be replaced by the error code.
    // Set to "" to display nothing
    "statusbar.messages_template": "{message}",

    "statusbar.show_active_linters": true,

    // Global styles for all linters.
    // Note: Styles can also be specified per linter! See above.
    // - mark_style:
    // - "none"
    // - "fill", "outline",
    // - "solid_underline", "squiggly_underline", "stippled_underline"
    // The underline styles are replaced with outlines when there is
    // whitespace in the problem region, because underlines aren't drawn
    // on whitespace (ST issue #137).
    // - icon:
    // - "circle", "dot" or "bookmark"
    // - "none" to remove the icon
    // - A path to an icon file like
    // "Packages/SublimeLinter/gutter-themes/Blueberry Cross/error.png"
    // - One provided by a gutter theme (e.g. "warning" or "error").
    // In theme Default: warning, error, cog, x,
    // and diamond, heart, pointer, square, star, triangle, which all
    // also have an -outline variant.
    // - scope:
    // Is used to determine the color. E.g. region.<colorish>, with one of
    // redish, orangish, yellowish, greenish, bluish, purplish, pinkish.
    // - priority:
    // Determines, for overlapping errors, which one is visualised.
    // - types:
    // An array which can contain "warning" and/or "error".
    // If omitted will match both.
    // - codes:
    // An array which can contain error codes provided by a linter.
    // Only valid as linter style in the "linters" section
    "styles": [
    {
    "scope": "region.yellowish markup.warning.sublime_linter",
    "types": ["warning"]
    },
    {
    "scope": "region.redish markup.error.sublime_linter",
    "types": ["error"]
    },
    {
    "priority": 1,
    "icon": "dot",
    "mark_style": "outline"
    }
    ],

    // DEPRECATED: use the selector linter setting instead:
    // http://www.sublimelinter.com/en/stable/linter_settings.html#selector
    // Maps variant syntaxes to the syntax that you have a linter for.
    // The syntax is the name of the syntax definition file, in lower case
    // Run this in the console to find it: view.settings().get('syntax').lower()
    "syntax_map": {
    "html (django)": "html",
    "html (rails)": "html",
    "html 5": "html",
    "javascript (babel)": "javascript",
    "magicpython": "python",
    "php": "html",
    "python django": "python",
    "pythonimproved": "python"
    }
    }

    6.重启sublime ,然后就可以看到报错的效果了:

  • 相关阅读:
    【Spring-Security】Re01 入门上手
    【JDBC】Extra03 PostgreSQL-JDBC
    【JDBC】Extra02 SqlServer-JDBC
    【JDBC】Extra01 Oracle-JDBC
    【Oracle】Windiws-11G 安装
    【Hibernate】Re08 加载策略配置
    【Hibernate】Re07 关系映射处理
    【Hibernate】Re01.6 HQL
    【Hibernate】Re01.5 API
    【Quartz】
  • 原文地址:https://www.cnblogs.com/Jackey-fighting/p/9150160.html
Copyright © 2020-2023  润新知