Code Monkey home page Code Monkey logo

vscode_python_mro's People

Stargazers

 avatar

Watchers

 avatar

vscode_python_mro's Issues

prepare for first publish

Prepare the project to publish on the VS Code Extension Marketplace, which includes the following tasks:

  • Remove the UML diagrams as they are outdated and no longer representative now
  • Update README.md to match the current project status
  • Add issue templates for bug, feature and pull request
  • Reorganise the project, remove unnecessary files and add necessary files

class diagram

To conceive the structure of the extension and draw the class diagram.

Use the correct `python` command to launch the MRO language server

Description

This project uses python3 -m mrols.server to launch the Python MRO language server behind the scene, however on some platform, like Windows, sometimes python3 is not available and python should be used in such case.

Expected Behavior

The program will successfully launch the MRO language server by the above command.

Actual Behavior

The program will fail to launch the MRO language server on a Windows with only a latest Python3 installed.

Possible Fix

Let the program be able to revert to use python if python3 failed, and to stop running and to give a feedback if both python3 and python fail.

Steps to Reproduce

  1. Prepare a clean Windows 10 with no Python installed
  2. Install the latest Python3 from the official website
  3. Enable the Python MRO VS Code extension
  4. This issue will appear

Simple foundation for client and server

Build a straightforward foundation for both the client and the server:

  • the client should be as simple as possible
  • the server will reply to both Hover and CodeLens request, but with straightforward and invariant response
  • build test examples and tests to check this simple foundation works correctly
  • set up the CI

Add messages to show the running status of the extension

Add support to show the running status of the extension in a separate channel in the Output panel.

Detailed Description

Currently, there is no way to inspect the running status of the extension, which is critical for monitoring and diagnostic purpose. Therefore, a proper way to log necessary debug information and show them is required. The Output panel is a good place for the display.

Possible Implementation

Add support to log necessary debug information for each step in the extension execution and direct the logging to a dedicated channel in the Output panel.

Your Environment

  • Version used: VS Code 1.46.3
  • Operating System and version: Ubuntu 18.04

use the added test examples on extension E2E test

To use the newly added test examples in PR #24 on the extension's E2E test.

Also to add E2E test, based on the added test examples, for the following cases:

  • multiple VS Code instances, possibly viewing a same file or different files
  • opening a new VS Code instance in the run
  • other 'resetting workspace' kind of operations

add more test examples

Adding more test examples to cover possible edge cases:

  • word class may appear in docstring, end-of-line comment, multi-line comment, string literals etc.
  • a class definition may appear in similar positions.
  • unnecessary space, new line, change line, line continuation or comments between keywords or brackets
  • syntax errors
  • long list of base parents
  • conflict MRO list
  • class definition across multiple files

client server communication via IPC

Attempt to implement the client-server communication via inter-process communication instead of the TCP based web socket, which may lead to a smaller latency.

integrate packaging and publishing into the CI process

Integrate the packaging and the pusblishing of the project into the CI process.

Detailed Description

Currently, the packaging of the project and the publishing to the VS Code extension placemarket is manually processed. This should be integrated into the CI process so that the packaging and the publishing will be automated if the CI is successful for a tagged version of the project.

Possible Implementation

  • Integrate the packaging and publishing into the CI process
  • Set them conditional so only to execute if the CI succeeds for a tagged version
  • Safely keep any secret key as encrypted secret

Your Environment

  • Version used: 0.0.1
  • Operating System and version: Ubuntu 18.04

activity diagram

Add the activity diagram for each type of use case (CodeLens, Hover and Hover Method).

Use case diagram

  • Think about the typical use cases of the extension.
  • List the use cases in a markdown note.
  • Illustrate the use cases in a use case diagram in the markdown note via PlantUML.

calculate MRO list

To implement the calculation of the MRO list by using Jedi and the synced documents.

This target can be decomposed into two steps:

  1. fetch the class definition signature and extract the base class list
  2. calculate the MRO list by the C3 linearization algorithm and recursive calculation of the MRO list of the parent classes until further inference is not possible

introduce Jedi

To introduce Jedi into the Language Server side for more accurate static analysis.

This introduction is planed to achieve by:

  • sync Jedi with the open documents (including the unsaved changes) and the workspace root folder
  • use Jedi to infer if the word in query is a class name or an object name, which further processing is needed

Simple Language Server in Python

Change the simple scaffolding Python language server (the server-side) from vscode-languageserver-based version to a simple copy written in Python:

  • still the same two language features: CodeLens and Hover
  • still the same trivial implementation: returning predefined constant values
  • the main goal is to understand how to write language server in Python

Extract test data into separate data file

  1. The unit-test related data, like the expected code lens content and numbers, should be extracted into a separate data file instead of being mixed in the test program file.
  2. There is a similar task for the E2E tests.

add pylint check

  • Add the pylint check into the project and ensure a good code quality (as a higher pylint score as possible).
  • Correct all bad practices unless it's really unavoidable (then use a command to ignore it).
  • Show a badge of the pylint score at the project readme.

Sync the documents

  • To sync the open documents between the client and language server using the language protocol's defined method and notification
  • Improve the two trivial uses of Hover and CodeLen so that they will only appear for the relevant objects
  • Update the unit tests to cover the language server written in Python

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.