eclipse / lsp4jakarta

Language Server for Jakarta EE
Eclipse Public License 2.0
34 stars 51 forks source link

Jakarta Servlet ServletConnection Snippet #421

Open pmd1nh opened 1 year ago

pmd1nh commented 1 year ago

Description:

EE10's Servlet 6.0 feature introduces new API to aid the debugging of application. New jakarta.servlet.ServletConnection class has 4 APIs. The instance of this class is accessed via the jakarta.servlet.ServletRequest.getServletConnection().

Note: jakarta.servlet.http.HttpServletRequest is a subclass of jakarta.servlet.ServletRequest thus it can also access the getServletConnection().

Suggest a snippet to automatically import both jakarta.servlet.http.HttpServletRequest and jakarta.servlet.ServletConnection on _servletconnection prefix.

Specification:

https://jakarta.ee/specifications/servlet/6.0/apidocs/jakarta.servlet/jakarta/servlet/servletconnection

https://jakarta.ee/specifications/servlet/6.0/apidocs/jakarta.servlet/jakarta/servlet/servletrequest#getServletConnection()

Type of language feature proposed:

Select all that apply

kathrynkodama commented 1 year ago

Potential snippet block that could resolve the necessary imports and get an instance of ServletConnection

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.ServletConnection;

protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
ServletConnection sConn = req.getServletConnection();