npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mysql_parser

v0.0.18

Published

```sequence Title:editor-parser模块交互流程图 participant 前端项目 as A participant editor_parser模块 as B participant 后端项目 as C

Downloads

8

Readme

Parser的外部交互流程图

Title:editor-parser模块交互流程图
participant 前端项目 as A
participant editor_parser模块 as B
participant 后端项目 as C

A -> B : 1.发起SQL解析请求(参数对象:EditorContext)
B -> B : 2.完成解析动作
B --> A : 3.返回解析出来的需要补全的对象(参数对象:CodeCompletionRequest)
A -> C : 4.请求补全列表(参数对象:CodeCompletionRequest)
C --> A : 5.返回补全列表(参数对象:list)
A ->A : 6.处理成Monaco补全的样式
A -> A : 7.进行补全提示

parser交互时序图.png

交互说明:

editor-parser模块

当前的语法解析模块,现阶段不区分SQL语言类型。

该模块被前端项目引用,该模块功能单一,仅处理SQL解析的问题,不处理提示的问题,提示的问题请在前端项目中完成。

该模块对前端项目仅暴露一个方法,该方法签名为:

/**
* 处理前端项目需要解析的SQL
* 参数:editorContext,编辑器上的内容和当前编辑器的一些参数
* 返回值: CodeCompletionRequest, 该对象表名当前需要补全的类型是什么
*/
parser(editorContext: EditorContext): CodeCompletionRequest{
  
}

editor-parser模块内部说明

Title:editor-parser模块内部时序图
participant client处理请求 as A
participant parser解析器 as B
participant symbolTable符号表 as C


A -> A : 1.检查数据EditorContext是否符合规范
A -> B : 2.交由parser进行解析
B -> C : 3.parser的监听器在解析过程中生成符号表
C --> B : 4.构建符号表完成
A -> B : 5.根据光标所在位置找到AST上对应的Token
B-->A: 6.返回当前光标所在Token
A -> C : 7.根据Token在符号表中查找是否有对应的变量Token
C --> A: 8.返回符号表中对应的变量Token
A -> A: 9.生成CodeCompletionRequest,并返回


parser内部时序图.png